Compare commits

...

2 commits

4 changed files with 17 additions and 9 deletions

View file

@ -5,6 +5,7 @@ version = "0.2.1"
authors = [ "Victor Mignot <dala@dalaran.fr>" ]
license = "EUPL-1.2"
readme = "README.md"
repository = "https://git.dalaran.fr/dala/yorokobot"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -12,10 +12,10 @@ use crate::discord::event_handler::Handler;
///
/// To launch Yorokobot, you have to set the following environment variables:
/// - DISCORD_TOKEN: The secret Discord provide you when creating a new bot in the
/// Discord Developper websites.
/// Discord Developper websites.
/// - MONGODB_URI: The connection string to your Mongo database.
/// - MONGODB_DATABASE: The database to use in your Mongo instance (falcultative if given in the
/// MONGODB_URI connection string).
/// MONGODB_URI connection string).
pub struct Client {
serenity_client: SerenityClient,
}

View file

@ -81,7 +81,7 @@ impl Client {
/// This method will panic if:
/// - The MONGODB_URI environment variable is not set.
/// - If the database to use is not specified in the connection string given with MONGODB_URI
/// and if MONGODB_DATABASE is not set.
/// and if MONGODB_DATABASE is not set.
/// - If the given credentials are invalid.
pub async fn connect(&mut self) {
self.mongo_client = match MongoClient::with_uri_str(get_env_variable("MONGODB_URI")).await {

View file

@ -61,13 +61,20 @@ impl EmbedMessageBuilder {
pub fn create_bot_credentials_embed(&self) -> CreateEmbed {
self.create_embed_base()
.title("Credentials")
.title("Yorokobot")
.fields(vec![
("Creator", "This bot was created by Victor Mignot (aka Dala).\nMastodon link: https://fosstodon.org/@Dala", false),
("License", "The source code is under the GNU Affero General Public License v3.0", false),
("Source code", "https://sr.ht/~dala/yorokobot/", false),
("Illustrator's Twitter", "https://twitter.com/MaewenMitzuki", false),
("Developer's Discord Server", "https://discord.gg/e8Q4zQbJb3", false),
("Version", env!("CARGO_PKG_VERSION"), false),
(
"License",
"The source code is under the European Union Public License v1.2",
false,
),
("Source code", env!("CARGO_PKG_REPOSITORY"), false),
(
"Illustrator's Twitter",
"https://twitter.com/MaewenMitzuki",
false,
),
])
.to_owned()
}