-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General, embed and level commands restructuring
NOTE: also moved the uptime command in the embed_commands module.
- Loading branch information
1 parent
a770601
commit 29bbe27
Showing
29 changed files
with
1,019 additions
and
938 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use super::*; | ||
|
||
/// Get the avatar for someone. | ||
#[poise::command(slash_command, prefix_command, rename = "avatar")] | ||
pub async fn avatar( | ||
ctx: Context<'_>, | ||
#[description = "Selected user"] user: Option<serenity::User>, | ||
) -> Result<(), Error> { | ||
let target_replied_user = user.as_ref().unwrap_or(get_replied_user(ctx).await); | ||
let response: String = format!("**{}**'s avatar:", target_replied_user.name); | ||
let user_avatar_as_embed: String = target_replied_user.face().replace(".webp", ".png"); | ||
|
||
let embed = serenity::CreateEmbed::new() | ||
.title(response) | ||
.color((255, 0, 0)) | ||
.image(user_avatar_as_embed); | ||
let full_respone = poise::CreateReply::default().embed(embed); | ||
ctx.send(full_respone).await?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
use super::*; | ||
|
||
/// Bonk someone who's horknee | ||
#[poise::command(prefix_command, slash_command, rename = "bonk")] | ||
pub async fn bonk( | ||
ctx: Context<'_>, | ||
#[description = "Selected user"] user: Option<serenity::User>, | ||
) -> Result<(), Error> { | ||
let target_replied_user = user.as_ref().unwrap_or(get_replied_user(ctx).await); | ||
let embed_item: &str = cmd_utils::get_embed_from_type(&EmbedType::Bonk).await?; | ||
let bot_user = Arc::clone(&ctx.data().bot_user); | ||
if target_replied_user == ctx.author() { | ||
ctx.send( | ||
poise::CreateReply::default().content("バカ!").embed( | ||
serenity::CreateEmbed::new() | ||
.color((255, 0, 0)) | ||
.image(embed_item.to_string()) | ||
.footer( | ||
serenity::CreateEmbedFooter::new(bot_user.tag()) | ||
.icon_url(Arc::clone(&ctx.data().bot_avatar).to_string()), | ||
), | ||
), | ||
) | ||
.await?; | ||
return Ok(()); | ||
} | ||
|
||
let response: String = format!( | ||
"**{}** *bonks* **{}**", | ||
ctx.author().name, | ||
target_replied_user.name | ||
); | ||
|
||
let ping_on_shash_command: Option<poise::serenity_prelude::Mention> = match ctx { | ||
poise::Context::Prefix(_) => None, | ||
poise::Context::Application(_) => Some(target_replied_user.mention()), | ||
}; | ||
|
||
let embed = serenity::CreateEmbed::new() | ||
.title(response) | ||
.color((255, 0, 0)) | ||
.image(embed_item.to_string()) | ||
.footer( | ||
serenity::CreateEmbedFooter::new(bot_user.tag()) | ||
.icon_url(Arc::clone(&ctx.data().bot_avatar).to_string()), | ||
); | ||
|
||
let full_respone = poise::CreateReply::default() | ||
.content(match ping_on_shash_command { | ||
Some(ping) => format!("{}", ping), | ||
None => "".to_owned(), | ||
}) | ||
.embed(embed); | ||
ctx.send(full_respone).await?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use super::*; | ||
|
||
/// Just try it. | ||
#[poise::command(slash_command, prefix_command, rename = "boom")] | ||
pub async fn boom(ctx: Context<'_>) -> Result<(), Error> { | ||
let bot_user = Arc::clone(&ctx.data().bot_user); | ||
let bot_avatar = bot_user.face().replace(".webp", ".png"); | ||
|
||
ctx.send( | ||
poise::CreateReply::default().embed( | ||
serenity::CreateEmbed::default() | ||
.image("https://raw.githubusercontent.com/1Git2Clone/serenity-discord-bot/main/src/assets/hu_boom.jpg") | ||
.color((255, 0, 0)) | ||
.footer(serenity::CreateEmbedFooter::new(bot_user.tag()).icon_url(bot_avatar)), | ||
), | ||
) | ||
.await?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
use super::*; | ||
|
||
/// Bury someone | ||
#[poise::command(prefix_command, slash_command, rename = "bury")] | ||
pub async fn bury( | ||
ctx: Context<'_>, | ||
#[description = "Selected user"] user: Option<serenity::User>, | ||
) -> Result<(), Error> { | ||
let target_replied_user = user.as_ref().unwrap_or(get_replied_user(ctx).await); | ||
let embed_item: &str = cmd_utils::get_embed_from_type(&EmbedType::Bury).await?; | ||
if target_replied_user == ctx.author() { | ||
ctx.send(poise::CreateReply::default().content(format!( | ||
"{} Just use the `!selfbury` or `/selfbury` command bruh...", | ||
target_replied_user.mention() | ||
))) | ||
.await?; | ||
return Ok(()); | ||
} | ||
|
||
let response: String = format!( | ||
"**{}** *buries* **{}**", | ||
ctx.author().name, | ||
target_replied_user.name | ||
); | ||
|
||
let ping_on_shash_command: Option<poise::serenity_prelude::Mention> = match ctx { | ||
poise::Context::Prefix(_) => None, | ||
poise::Context::Application(_) => Some(target_replied_user.mention()), | ||
}; | ||
let bot_user = Arc::clone(&ctx.data().bot_user); | ||
|
||
let embed = serenity::CreateEmbed::new() | ||
.title(response) | ||
.color((255, 0, 0)) | ||
.image(embed_item.to_string()) | ||
.footer( | ||
serenity::CreateEmbedFooter::new(bot_user.tag()) | ||
.icon_url(Arc::clone(&ctx.data().bot_avatar).to_string()), | ||
); | ||
|
||
let full_respone = poise::CreateReply::default() | ||
.content(match ping_on_shash_command { | ||
Some(ping) => format!("{}", ping), | ||
None => "".to_owned(), | ||
}) | ||
.embed(embed); | ||
ctx.send(full_respone).await?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use super::*; | ||
|
||
/// Get a motivation chair GIF | ||
#[poise::command(slash_command, prefix_command, rename = "chair")] | ||
pub async fn chair(ctx: Context<'_>) -> Result<(), Error> { | ||
let embed_item: &str = cmd_utils::get_embed_from_type(&EmbedType::Chair).await?; | ||
let bot_user = Arc::clone(&ctx.data().bot_user); | ||
|
||
let embed = serenity::CreateEmbed::new() | ||
.title("You need some motivation!") | ||
.color((255, 0, 0)) | ||
.image(embed_item) | ||
.footer( | ||
serenity::CreateEmbedFooter::new(bot_user.tag()) | ||
.icon_url(Arc::clone(&ctx.data().bot_avatar).to_string()), | ||
); | ||
let full_respone = poise::CreateReply::default().embed(embed); | ||
ctx.send(full_respone).await?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use super::*; | ||
|
||
/// Get a Ryan Gosling drive GIF. | ||
#[poise::command(slash_command, prefix_command, rename = "drive")] | ||
pub async fn drive(ctx: Context<'_>) -> Result<(), Error> { | ||
let embed_item: &str = cmd_utils::get_embed_from_type(&EmbedType::RyanGoslingDrive).await?; | ||
|
||
let embed = serenity::CreateEmbed::new() | ||
// .title() | ||
.color((255, 0, 0)) | ||
.image(embed_item); | ||
let full_respone = poise::CreateReply::default().embed(embed); | ||
ctx.send(full_respone).await?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
use super::*; | ||
|
||
/// Hug someone | ||
#[poise::command(prefix_command, slash_command, rename = "hug")] | ||
pub async fn hug( | ||
ctx: Context<'_>, | ||
#[description = "Selected user"] user: Option<serenity::User>, | ||
) -> Result<(), Error> { | ||
let target_replied_user = user.as_ref().unwrap_or(get_replied_user(ctx).await); | ||
let embed_item: &str = cmd_utils::get_embed_from_type(&EmbedType::Hug).await?; | ||
let bot_user = Arc::clone(&ctx.data().bot_user); | ||
if target_replied_user == ctx.author() { | ||
ctx.send( | ||
poise::CreateReply::default() | ||
.content("Aww~ I'll hug you!") | ||
.embed( | ||
serenity::CreateEmbed::new() | ||
.color((255, 0, 0)) | ||
.image(embed_item.to_string()) | ||
.footer( | ||
serenity::CreateEmbedFooter::new(bot_user.tag()) | ||
.icon_url(Arc::clone(&ctx.data().bot_avatar).to_string()), | ||
), | ||
), | ||
) | ||
.await?; | ||
return Ok(()); | ||
} | ||
|
||
let response: String = format!( | ||
"**{}** *hugs* **{}**", | ||
ctx.author().name, | ||
target_replied_user.name | ||
); | ||
|
||
let ping_on_shash_command: Option<poise::serenity_prelude::Mention> = match ctx { | ||
poise::Context::Prefix(_) => None, | ||
poise::Context::Application(_) => Some(target_replied_user.mention()), | ||
}; | ||
|
||
let embed = serenity::CreateEmbed::new() | ||
.title(response) | ||
.color((255, 0, 0)) | ||
.image(embed_item.to_string()) | ||
.footer( | ||
serenity::CreateEmbedFooter::new(bot_user.tag()) | ||
.icon_url(Arc::clone(&ctx.data().bot_avatar).to_string()), | ||
); | ||
|
||
let full_respone = poise::CreateReply::default() | ||
.content(match ping_on_shash_command { | ||
Some(ping) => format!("{}", ping), | ||
None => "".to_owned(), | ||
}) | ||
.embed(embed); | ||
ctx.send(full_respone).await?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
use super::*; | ||
|
||
/// Kick someone | ||
#[poise::command(prefix_command, slash_command, rename = "kick")] | ||
pub async fn kick( | ||
ctx: Context<'_>, | ||
#[description = "Selected user"] user: Option<serenity::User>, | ||
) -> Result<(), Error> { | ||
let target_replied_user = user.as_ref().unwrap_or(get_replied_user(ctx).await); | ||
let embed_item: &str = cmd_utils::get_embed_from_type(&EmbedType::Kick).await?; | ||
if target_replied_user == ctx.author() { | ||
ctx.send(poise::CreateReply::default().content(format!( | ||
"{}, why would you kick yourself...? Weirdo...", | ||
target_replied_user.mention() | ||
))) | ||
.await?; | ||
return Ok(()); | ||
} | ||
|
||
let response: String = format!( | ||
"**{}** *kicks* **{}**", | ||
ctx.author().name, | ||
target_replied_user.name | ||
); | ||
|
||
let ping_on_shash_command: Option<poise::serenity_prelude::Mention> = match ctx { | ||
poise::Context::Prefix(_) => None, | ||
poise::Context::Application(_) => Some(target_replied_user.mention()), | ||
}; | ||
|
||
let bot_user = Arc::clone(&ctx.data().bot_user); | ||
|
||
let embed = serenity::CreateEmbed::new() | ||
.title(response) | ||
.color((255, 0, 0)) | ||
.image(embed_item.to_string()) | ||
.footer( | ||
serenity::CreateEmbedFooter::new(bot_user.tag()) | ||
.icon_url(Arc::clone(&ctx.data().bot_avatar).to_string()), | ||
); | ||
|
||
let full_respone = poise::CreateReply::default() | ||
.content(match ping_on_shash_command { | ||
Some(ping) => format!("{}", ping), | ||
None => "".to_owned(), | ||
}) | ||
.embed(embed); | ||
ctx.send(full_respone).await?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
use super::*; | ||
|
||
/// Kill someone (Sadge) | ||
#[poise::command(prefix_command, slash_command, rename = "kill")] | ||
pub async fn kill( | ||
ctx: Context<'_>, | ||
#[description = "Selected user"] user: Option<serenity::User>, | ||
) -> Result<(), Error> { | ||
let target_replied_user = user.as_ref().unwrap_or(get_replied_user(ctx).await); | ||
let embed_item: &str = cmd_utils::get_embed_from_type(&EmbedType::Kill).await?; | ||
if target_replied_user == ctx.author() { | ||
ctx.send(poise::CreateReply::default().content("No.")) | ||
.await?; | ||
return Ok(()); | ||
} | ||
|
||
let response: String = format!( | ||
"**{}** *kills* **{}**", | ||
ctx.author().name, | ||
target_replied_user.name | ||
); | ||
|
||
let ping_on_shash_command: Option<poise::serenity_prelude::Mention> = match ctx { | ||
poise::Context::Prefix(_) => None, | ||
poise::Context::Application(_) => Some(target_replied_user.mention()), | ||
}; | ||
|
||
let bot_user = Arc::clone(&ctx.data().bot_user); | ||
|
||
let embed = serenity::CreateEmbed::new() | ||
.title(response) | ||
.color((255, 0, 0)) | ||
.image(embed_item.to_string()) | ||
.footer( | ||
serenity::CreateEmbedFooter::new(bot_user.tag()) | ||
.icon_url(Arc::clone(&ctx.data().bot_avatar).to_string()), | ||
); | ||
|
||
let full_respone = poise::CreateReply::default() | ||
.content(match ping_on_shash_command { | ||
Some(ping) => format!("{}", ping), | ||
None => "".to_owned(), | ||
}) | ||
.embed(embed); | ||
ctx.send(full_respone).await?; | ||
|
||
Ok(()) | ||
} |
Oops, something went wrong.