Bot for Discord that replays Quotes written in Rust
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Steven vanZyl d99aa5b8bb Started rust-embed 8 months ago
sql Started rust-embed 8 months ago
src Started rust-embed 8 months ago
.gitignore ignore and remove file 1 year ago
Cargo.lock Started rust-embed 8 months ago
Cargo.toml Started rust-embed 8 months ago
LICENSE Add license 2 years ago
README.md Started rust-embed 8 months ago

README.md

Version 3 rewrite in Rust! Crates:

  • Serenity: Discord API wrapper
  • Rustqlite or Diesel: Database wrapper

This time using a proper SQLite database!

Schema

Database schema. Depending on the wrapper will be done with manual SQL.

Server

  • id: number primary
  • discord_id: text
  • default_channel_id: text

The following are all server options.

  • prefix: character
  • login_quotes: boolean
  • login_quote_timeout: number
  • cross_server_quotes: boolean
  • allow_toy_commands: boolean
  • allow_util_commands: boolean
  • allow_user_delete: boolean
  • allow_user_replace: boolean
  • cleanup_after_user: boolean

Users

  • id: number primary
  • discord_id: text
  • admin_of_servers: number[]

Quotes

  • id: number primary
  • user: number
  • server: number
  • text: text
  • votes: number
  • deleted: boolean

Config

This is only a single row containing the bot-specific settings.

  • owner_id: text
  • token: text
  • util_enabled: boolean
  • toy_enabled: boolean

Structs

Additional structs for various purposes.

BotConfig

Contains all the values from the database in a struct. Functions include database manipulation.

ServerConfig

Contains all the values from the database in a struct. Functions include database manipulation.

Commands

Command groups and related functions should be organized into Structs perhaps with some shared Traits. Some these might be behind feature flags.

Meta

  • help: DMs the user with the help text.
  • about: Puts the bot about text.

Quote

  • add <user> <text>: Adds a quote for a user.
  • remove <user> <number>: removes a quote from a user.
  • replace <user> <number> <text>: Replaces a quote with another.
  • get <user> <number>: Gets the numbered quote for a user.
  • random <user>: A random quote by a user.

Admin

  • settings: prints the current server settings.
  • prefix <character>: sets the command prefix.
  • toggle <option>: toggles a boolean setting.
  • set <option> <value>: sets an option to value.

Util

Toy

  • e: End it all…