Some fixes and improvements

This commit is contained in:
Tom 2022-02-03 16:30:03 +01:00
parent 643aa42cd3
commit 9e03e8be42
4 changed files with 20 additions and 3 deletions

Binary file not shown.

View file

@ -60,6 +60,7 @@ pub enum InviteActions {
User,
}
/// Information about invites
#[poise::command(slash_command)]
pub async fn invites(
ctx: Context<'_>,

View file

@ -358,6 +358,7 @@ async fn autocomplete_session(_ctx: Context<'_>, partial: String) -> impl Stream
.map(|name| name.to_string())
}
/// F1 schedules
#[poise::command(slash_command)]
pub async fn schedule(
ctx: Context<'_>,

View file

@ -46,7 +46,7 @@ pub async fn boop(ctx: Context<'_>) -> Result<(), Error> {
let uuid_boop = ctx.id();
ctx.send(|m| {
m.content("I want some boops!").components(|c| {
m.content("I want some boops! 🐇").components(|c| {
c.create_action_row(|ar| {
ar.create_button(|b| {
b.style(serenity::ButtonStyle::Primary)
@ -60,7 +60,6 @@ pub async fn boop(ctx: Context<'_>) -> Result<(), Error> {
let mut boop_count = 0;
while let Some(mci) = serenity::CollectComponentInteraction::new(ctx.discord())
.author_id(ctx.author().id)
.channel_id(ctx.channel_id())
.timeout(std::time::Duration::from_secs(1200))
.filter(move |mci| mci.data.custom_id == uuid_boop.to_string())
@ -70,7 +69,23 @@ pub async fn boop(ctx: Context<'_>) -> Result<(), Error> {
let mut msg = mci.message.clone();
msg.edit(ctx.discord(), |m| {
m.content(format!("Boop count: {}", boop_count))
m.content(match &boop_count {
2 => "Boop count: <:HamSmile:738765923401596991>".to_string(),
42 => "Boop count: 42, but what is the question?".to_string(),
43 => "Boop count: 43 A wild <@230001507481681920> appeared".to_string(),
69 => "Boop count: 69 Nice!".to_string(),
77 => "Boop count: 77 <@547041420733841409> Aproved".to_string(),
308 => "Redirect 308: Boop count is in another castle".to_string(),
400 => "ERROR 400: Bad booping".to_string(),
401 => "ERROR 401: Unauthorized booping".to_string(),
402 => "ERROR 402: Payment required, no free boops".to_string(),
403 => "ERROR 403: Forbidden boop".to_string(),
404 => "ERROR 404: Boop count not found".to_string(),
420 => "Boop count: 420 Blaze it".to_string(),
666 => "Boop count: 666 😈".to_string(),
777 => "Boop count: 777 A wild <@117992484310745097> appeared".to_string(),
_ => format!("Boop count: {}", boop_count),
})
})
.await?;