diff --git a/src/commands/moover/moove.rs b/src/commands/moover/moove.rs index c1a1414..e4e5f2b 100644 --- a/src/commands/moover/moove.rs +++ b/src/commands/moover/moove.rs @@ -51,7 +51,7 @@ pub async fn moove(http: Arc, msg: Message, m_channel_id: u64) -> anyhow:: .map(| embed | CreateEmbed::from(embed)) .collect(); - + let mut new_content = format!("Sent by {}\n mooved {}\n", msg_to_moove.author, msg.author); let mut new_msg = CreateMessage::new(); @@ -68,7 +68,7 @@ pub async fn moove(http: Arc, msg: Message, m_channel_id: u64) -> anyhow:: let embed = CreateEmbed::new() .field("MOO", new_content, false) .field("Message:\n", msg_to_moove.content.clone(), false); - + new_msg = new_msg.add_embed(embed); } diff --git a/src/commands/voice/radio/radio_utils.rs b/src/commands/voice/radio/radio_utils.rs index 08e5a79..ce237e6 100644 --- a/src/commands/voice/radio/radio_utils.rs +++ b/src/commands/voice/radio/radio_utils.rs @@ -16,32 +16,32 @@ pub async fn paginate_search_stations( let ctx_id = ctx.id(); let prev_button_id = format!("{}prev", ctx_id); let next_button_id = format!("{}next", ctx_id); - + let search_builder = search_builder; - + let Ok(stations) = search_builder.clone().send().await else { ctx.reply_ephemeral("Something went wrong, try searching again").await?; return Ok(()) }; - + let mut page = 0; - + let embed = create_station_list_embed(&stations, page); - + // Send the embed with the first page as content let reply = { let components = CreateActionRow::Buttons(vec![ CreateButton::new(&prev_button_id).emoji('◀'), CreateButton::new(&next_button_id).emoji('▶'), ]); - + CreateReply::default() .embed(embed) .components(vec![components]) }; - + ctx.send(reply).await?; - + // Loop through incoming interactions with the navigation buttons let mut offset = 0; let limit_int = limit as u32; @@ -73,16 +73,16 @@ pub async fn paginate_search_stations( if stations.is_empty() { offset = 0; page = 0; - + let Ok(new_stations) = search_builder.clone().offset(offset.to_string()).send().await else { ctx.reply_ephemeral("Something went wrong, try searching again").await?; return Ok(()) }; stations = new_stations; } - + let embed = create_station_list_embed(&stations, page); - + // Update the message with the new page contents press .create_response( diff --git a/src/message_handler.rs b/src/message_handler.rs index c14d392..5bc7858 100644 --- a/src/message_handler.rs +++ b/src/message_handler.rs @@ -15,7 +15,7 @@ pub async fn handle(ctx: Context, msg: Message) { if msg.author.bot { return } - + let lower_case_content = msg.content.to_lowercase(); let bot_id = ctx.cache.current_user().id; @@ -31,7 +31,7 @@ pub async fn handle(ctx: Context, msg: Message) { return } } - + // X and IG not embedding correctly (IG fix does not work for now need to find different one) let link_fixes = HashMap::from([ ("//x.com", "//fixvx.com") @@ -96,7 +96,7 @@ async fn henlo(http: Arc, msg: Message) -> bool { let emoji = EMOJIS.choose(&mut rand::rng()).unwrap_or(&"🐮"); let response = format!("Henlooo {} {}", msg.author.name, emoji); - + match msg.reply(http.clone(), response).await { Ok(_) => { return true } Err(e) => { diff --git a/src/other/notice.rs b/src/other/notice.rs index 7f03855..4be79cc 100644 --- a/src/other/notice.rs +++ b/src/other/notice.rs @@ -26,13 +26,13 @@ pub async fn notice_wrapper(ctx: Context) { /// Send embed with event name and optional special message to guild's general channel async fn announce_event(guild_id: GuildId, name: &str, special_message: &str, http: Arc) -> anyhow::Result<()> { - + let mut event_embed = CreateEmbed::new() .color(Colour::new(rand::random::() % 0xFFFFFF)) .title("Today's event is:"); let system_channel = utilities::get_system_channel(guild_id, &http).await?; - + if special_message.contains("http") { event_embed = event_embed.description(name); system_channel.send_message(http.clone(), diff --git a/src/utils/debug.rs b/src/utils/debug.rs index e8c1d6b..d5e9efa 100644 --- a/src/utils/debug.rs +++ b/src/utils/debug.rs @@ -4,13 +4,13 @@ use serenity::http::Http; pub async fn send_error(_http: Arc, msg: String) -> anyhow::Result<()> { println!("ERROR: {msg}"); - + #[cfg(feature="RELEASE")] { use serenity::all::ChannelId; use std::process::exit; use std::env; use anyhow::Context; - + let channel_id: String = env::var("DEBUG_CHANNEL_ID").context("DEBUG_CHANNEL_ID not found in env file")?; match ChannelId::new(channel_id.parse::().unwrap()) .say(_http, msg).await { @@ -20,7 +20,7 @@ pub async fn send_error(_http: Arc, msg: String) -> anyhow::Result<()> { } Ok(()) } - + #[cfg(feature="RELEASE")] pub async fn hello(http: Arc) -> anyhow::Result<()> { use serenity::all::ChannelId; @@ -40,7 +40,7 @@ pub async fn hello(http: Arc) -> anyhow::Result<()> { ]; let message = messages.choose(&mut rand::rng()).unwrap_or(&"Chello").to_string(); - + let channel_id: String = env::var("DEBUG_CHANNEL_ID").context("DEBUG_CHANNEL_ID not found in env file")?; let channel = ChannelId::new(channel_id.parse::().unwrap()); if let Err(why) = channel.say(http, message).await {