Skip to content
This repository was archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
Por algum motivo n foi tudo
Browse files Browse the repository at this point in the history
  • Loading branch information
vulcandragi committed Jun 16, 2021
1 parent 92c2748 commit 194b1ef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions example.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
KUROSAWA_TOKEN=coloque o token aqui
KUROSAWA_BOT_ID=coloquei o id aqui
KUROSAWA_BOT_PREFIX=coloque aqui o prefixo
KUROSAWA_WEEB_API_TOKEN=coloque o token da api aqui
KUROSAWA_DATABASE_CONNECTION_STRING=mysql://root:password@localhost:3306
KUROSAWA_DATABASE_NAME=kurosawa_dia
Expand Down
5 changes: 1 addition & 4 deletions src/commands/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use serenity::{
};

use crate::{
config::get_default_prefix,
database::functions::guild::set_prefix,
utils::constants::{colors, emojis},
};
Expand All @@ -33,9 +32,7 @@ pub struct Config;
#[usage("prefix <novo prefixo>")]
#[example("prefix +")]
async fn prefix(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
let new_prefix = args
.single::<String>()
.unwrap_or_else(|_| get_default_prefix());
let new_prefix = args.single::<String>()?;

if new_prefix.len() > 15 {
return Err("Prefixo deve ser menor que 15".into());
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn get_database_name() -> String {
}

pub fn get_default_prefix() -> String {
"~".to_string()
var("KUROSAWA_BOT_PREFIX").unwrap_or_else(|_| "~".to_string())
}

pub fn get_id_mention() -> Option<UserId> {
Expand Down

0 comments on commit 194b1ef

Please sign in to comment.