diff options
| author | Fuwn <[email protected]> | 2020-10-27 13:46:50 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2020-10-27 13:46:50 -0700 |
| commit | 7df153d4dd8279d1187deb8ad7cd90813cae153b (patch) | |
| tree | 2a5258b4eff8c79b0e349eaa15154b0b6ea1d1d9 /src/modules | |
| parent | chore: change workflow name and step name (diff) | |
| download | dep-core-next-7df153d4dd8279d1187deb8ad7cd90813cae153b.tar.xz dep-core-next-7df153d4dd8279d1187deb8ad7cd90813cae153b.zip | |
feat, annotate, chore (desc)
feat:
- feature request
- github organization
- change up the `uwu!` response
- add parse and send goodbye to utils
- add goodbye stuff to config model
- add aliases to ignore remove and list
- add alias to russian roulette
annotate:
- framework.rs
chore:
- change command group names
- add discriminator to ready log
- add period to fern log output
- change up order of server info command + add stuff metnioned above
other:
- comment out config goodbye
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/commands/admins/config.rs | 132 | ||||
| -rw-r--r-- | src/modules/commands/admins/ignore.rs | 2 | ||||
| -rw-r--r-- | src/modules/commands/general/fun.rs | 5 | ||||
| -rw-r--r-- | src/modules/commands/general/utilities.rs | 14 |
4 files changed, 77 insertions, 76 deletions
diff --git a/src/modules/commands/admins/config.rs b/src/modules/commands/admins/config.rs index a26fc3d..43e2215 100644 --- a/src/modules/commands/admins/config.rs +++ b/src/modules/commands/admins/config.rs @@ -505,73 +505,73 @@ impl Command for ConfigWelcome { } } -pub struct ConfigGoodbye; -impl Command for ConfigGoodbye { - fn options(&self) -> Arc<CommandOptions> { - let default = CommandOptions::default(); - let options = CommandOptions { - // desc: Some("Change welcome message settings.\nOption is one of enable, disable, channel, message, type and the respective values should be none, none, channel_resolvable, desired message.\nType designates if the message is plain or embed. Anything other than embed will result in plain.".to_string()), - desc: Some("People leaving you ? At least make it cool and custom.\n\nOptions:\n`enable` - none.\n`disable` - none.\n`channel` - `channel_resolvable` (Mentionable).\n`message` - Your desired welcome message.\n`type` - `plain` or `embed`.".to_string()), - usage: Some("<option> <value>".to_string()), - example: Some("message {user} has left {guild}...".to_string()), - min_args: Some(1), - required_permissions: Permissions::MANAGE_GUILD, - ..default - }; - Arc::new(options) - } +// pub struct ConfigGoodbye; +// impl Command for ConfigGoodbye { +// fn options(&self) -> Arc<CommandOptions> { +// let default = CommandOptions::default(); +// let options = CommandOptions { +// // desc: Some("Change welcome message settings.\nOption is one of enable, disable, channel, message, type and the respective values should be none, none, channel_resolvable, desired message.\nType designates if the message is plain or embed. Anything other than embed will result in plain.".to_string()), +// desc: Some("People leaving you ? At least make it cool and custom.\n\nOptions:\n`enable` - none.\n`disable` - none.\n`channel` - `channel_resolvable` (Mentionable).\n`message` - Your desired welcome message.\n`type` - `plain` or `embed`.".to_string()), +// usage: Some("<option> <value>".to_string()), +// example: Some("message {user} has left {guild}...".to_string()), +// min_args: Some(1), +// required_permissions: Permissions::MANAGE_GUILD, +// ..default +// }; +// Arc::new(options) +// } - fn execute(&self, _: &mut Context, message: &Message, mut args: Args) -> Result<(), CommandError> { - if let Some(guild_id) = message.guild_id { - let mut guild_data = db.get_guild(guild_id.0 as i64)?; - let op = args.single::<String>().unwrap_or(String::new()); - let mut val = args.rest().to_string(); - match op.to_lowercase().as_str() { - "enable" => { - guild_data.welcome = true; - }, - "disable" => { - guild_data.welcome = false; - }, - "channel" => { - match parse_channel(val.to_string(), guild_id) { - Some((channel_id, channel)) => { - guild_data.welcome_channel = channel_id.0 as i64; - val = format!("{} ({})", channel.name, channel_id.0); - }, - None => { - message.channel_id.say("I couldn't find that channel.")?; - return Ok(()) - }, - } - }, - "message" => { - guild_data.welcome_message = val.to_string(); - }, - "type" => { - guild_data.welcome_type = val.to_string(); - }, - _ => { - message.channel_id.say("I didn't understand that option. Valid options are: `enable`, `disable`, `channel`, `message`, `type`. For more information see `help config goodbye`")?; - return Ok(()) - }, - } - let guild = db.update_guild(guild_id.0 as i64, guild_data)?; - message.channel_id.send_message(|m| m - .embed(|e| e - .title("Goodbye Configuration Summary") - .colour(*colours::MAIN) - .description(format!("**Operation:** {}\n**Value:** {}", - op, - if val.is_empty() { guild.welcome.to_string() } else { val }, - )) - ))?; - } else { - failed!(GUILDID_FAIL); - } - Ok(()) - } -} +// fn execute(&self, _: &mut Context, message: &Message, mut args: Args) -> Result<(), CommandError> { +// if let Some(guild_id) = message.guild_id { +// let mut guild_data = db.get_guild(guild_id.0 as i64)?; +// let op = args.single::<String>().unwrap_or(String::new()); +// let mut val = args.rest().to_string(); +// match op.to_lowercase().as_str() { +// "enable" => { +// guild_data.welcome = true; +// }, +// "disable" => { +// guild_data.welcome = false; +// }, +// "channel" => { +// match parse_channel(val.to_string(), guild_id) { +// Some((channel_id, channel)) => { +// guild_data.welcome_channel = channel_id.0 as i64; +// val = format!("{} ({})", channel.name, channel_id.0); +// }, +// None => { +// message.channel_id.say("I couldn't find that channel.")?; +// return Ok(()) +// }, +// } +// }, +// "message" => { +// guild_data.welcome_message = val.to_string(); +// }, +// "type" => { +// guild_data.welcome_type = val.to_string(); +// }, +// _ => { +// message.channel_id.say("I didn't understand that option. Valid options are: `enable`, `disable`, `channel`, `message`, `type`. For more information see `help config goodbye`")?; +// return Ok(()) +// }, +// } +// let guild = db.update_guild(guild_id.0 as i64, guild_data)?; +// message.channel_id.send_message(|m| m +// .embed(|e| e +// .title("Goodbye Configuration Summary") +// .colour(*colours::MAIN) +// .description(format!("**Operation:** {}\n**Value:** {}", +// op, +// if val.is_empty() { guild.welcome.to_string() } else { val }, +// )) +// ))?; +// } else { +// failed!(GUILDID_FAIL); +// } +// Ok(()) +// } +// } pub struct ConfigIntroduction; impl Command for ConfigIntroduction { diff --git a/src/modules/commands/admins/ignore.rs b/src/modules/commands/admins/ignore.rs index efafdac..a716a45 100644 --- a/src/modules/commands/admins/ignore.rs +++ b/src/modules/commands/admins/ignore.rs @@ -59,6 +59,7 @@ impl Command for IgnoreRemove { let default = CommandOptions::default(); let options = CommandOptions { desc: Some("Finally, I can see.".to_string()), + aliases: vec!["rm", "delete", "del"].iter().map(|e| e.to_string()).collect(), usage: Some("<channel_resolvable>".to_string()), example: Some("#general".to_string()), min_args: Some(1), @@ -99,6 +100,7 @@ impl Command for IgnoreList { let default = CommandOptions::default(); let options = CommandOptions { desc: Some("You want ME to tell YOU want channels I'm ignoring ?.".to_string()), + aliases: vec!["ls"].iter().map(|e| e.to_string()).collect(), required_permissions: Permissions::MANAGE_GUILD, max_args: Some(0), ..default diff --git a/src/modules/commands/general/fun.rs b/src/modules/commands/general/fun.rs index 79f37c9..75243d2 100644 --- a/src/modules/commands/general/fun.rs +++ b/src/modules/commands/general/fun.rs @@ -228,10 +228,7 @@ impl Command for RussianRoulette { let default = CommandOptions::default(); let options = CommandOptions { desc: Some("A simple game, one in the chamber, who gets splattered ?".to_string()), - // usage: Some("[tags]".to_string()), - // example: Some("minecraft".to_string()), - // aliases: vec!["furry"].iter().map(|e| e.to_string()).collect(), - // owner_privileges: false, + aliases: vec!["rr"].iter().map(|e| e.to_string()).collect(), ..default }; Arc::new(options) diff --git a/src/modules/commands/general/utilities.rs b/src/modules/commands/general/utilities.rs index fc6fc36..74052de 100644 --- a/src/modules/commands/general/utilities.rs +++ b/src/modules/commands/general/utilities.rs @@ -344,15 +344,15 @@ impl Command for ServerInfo { .embed(|e| e .thumbnail(guild.icon_url().unwrap_or("https://cdn.discordapp.com/embed/avatars/0.png".to_string())) .color(*colours::MAIN) - .field("ID", guild.id, true) .field("Name", &guild.name, true) + .field("ID", guild.id, true) .field("Owner", guild.owner_id.mention(), true) .field("Region", guild.region, true) - .field(format!("Channels [{}]", guild.channels.len()), format!("Categories: {}\nText: {}\nVoice: {}", channels.2, channels.0, channels.1), true) .field(format!("Members [{}/{}]", members.2, guild.members.len()), format!("Humans: {}\nBots: {}", members.0, members.1), true) - .field("Created", guild.id.created_at().format("%a, %d %h %Y @ %H:%M:%S").to_string(), false) + .field(format!("Channels [{}]", guild.channels.len()), format!("Categories: {}\nText: {}\nVoice: {}", channels.2, channels.0, channels.1), true) .field("Roles", guild.roles.len(), true) .field("Emojis", guild.emojis.len(), true) + .field("Created", guild.id.created_at().format("%a, %d %h %Y @ %H:%M:%S").to_string(), false) .title(guild.name) ))?; }, @@ -708,7 +708,7 @@ impl Command for Wisp { .description("Hey ! I'm Wisp, I was written in [Rust](https://www.rust-lang.org/) using [Serenity](https://github.com/serenity-rs/serenity).") .field("Owner/ Developer", format!( "Name: {}\nID: {}" - ,owner.tag() + ,owner.mention() ,owner.id) ,true) // .field("Links", format!( @@ -720,8 +720,10 @@ impl Command for Wisp { // ,true) .field("Useful Links", format!( // "[Support Server]({})\n[Invite]({})\n[GitLab]({})\n[Patreon]({})" - "[Invite]({})" - // ,SUPPORT_SERV_INVITE + "[Support Server]({})\n[GitHub Organization]({})\n[Feature Request]({})\n[Invite]({})" + ,SUPPORT_SERV_INVITE + ,GITHUB_ORG_LINK + ,FEATURE_REQUEST_LINK ,BOT_INVITE) // ,GITLAB_LINK // ,PATREON_LINK) |