||3 years ago|
|src||3 years ago|
|Cargo.toml||3 years ago|
|README.md||3 years ago|
Echobox is a database of quotes. You put in a quote, it will return back a quote. The echobox is backed by a sqlite database.
Echobox was inspired by fivequestionmarks's
!echobox command; accordingly, it is mainly intended for use in a tenquestionmarks module. However, this Echobox may not behave the same way the original does.
echo(&str) may return back the input quote (not sure if fivequestionmarks does this or not).
cargo run "<quote>"
- The entire quote is one argument, so it needs to be quoted if there are spaces.
- Echobox uses the file
echobox.dbin the current working directory. There is currently not a way to change this.
Echobox type provides two constructors,
Echobox::with_connection(sqlite::Connection). Both of these will create the database, including the single table, if it does not exist. The
Echobox provides three methods,
echo(&str) which inserts the input quote into the database and then returns a single random
Quote from the database,
put(&str) which inserts a quote, and
get(i64) which returns a
Vec<Quote> containing the requested number of random quotes.
Quote struct represents a single quote from the echobox, and has