Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/commands/edit/message_ops.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::config::Config;
use crate::db::messages::{get_thread_message_by_inbox_message_id, MessageIds};
use crate::db::messages::{MessageIds, get_thread_message_by_inbox_message_id};
use crate::db::operations::{
get_message_ids_by_number, get_thread_by_channel_id, get_user_id_from_channel_id,
};
use crate::errors::common::{incorrect_message_id, not_found, permission_denied, thread_not_found};
use crate::errors::MessageError::{DmAccessFailed, EditFailed};
use crate::errors::common::{incorrect_message_id, not_found, permission_denied, thread_not_found};
use crate::errors::{ModmailError, ModmailResult};
use crate::utils::conversion::hex_string_to_int::hex_string_to_int;
use crate::utils::message::message_builder::MessageBuilder;
Expand Down
8 changes: 3 additions & 5 deletions src/commands/move_thread/slash_command/move_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::utils::command::defer_response::defer_response;
use crate::utils::message::message_builder::MessageBuilder;
use serenity::all::{
CommandInteraction, CommandOptionType, Context, CreateCommand, CreateCommandOption,
CreateInteractionResponse, ResolvedOption,
ResolvedOption,
};
use std::collections::HashMap;

Expand Down Expand Up @@ -109,12 +109,10 @@ pub async fn run(
)
.await
.to_channel(command.channel_id)
.build_interaction_message()
.build_interaction_message_followup()
.await;

command
.create_response(&ctx.http, CreateInteractionResponse::Message(response))
.await?;
command.create_followup(&ctx.http, response).await?;

Ok(())
}
Expand Down
11 changes: 4 additions & 7 deletions src/errors/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ use crate::errors::dictionary::DictionaryManager;
use crate::errors::types::{ModmailError, ModmailResult};
use crate::i18n::languages::{Language, LanguageDetector, LanguagePreferences};
use serenity::all::{
ChannelId, Colour, CommandInteraction, Context, CreateEmbed, CreateInteractionResponseMessage,
ChannelId, Colour, CommandInteraction, Context, CreateEmbed, CreateInteractionResponseFollowup,
CreateMessage, Message, UserId,
};
use serenity::builder::CreateInteractionResponse;
use std::collections::HashMap;
use std::sync::Arc;
use tokio::sync::RwLock;
Expand Down Expand Up @@ -154,7 +153,7 @@ impl ErrorHandler {
ctx: &Context,
command: &CommandInteraction,
error: &ModmailError,
) -> Result<(), serenity::Error> {
) -> Result<Message, serenity::Error> {
let formatted_error = self
.handle_error(
error,
Expand All @@ -166,11 +165,9 @@ impl ErrorHandler {
let embed = self.create_error_embed(&formatted_error).await;

command
.create_response(
.create_followup(
&ctx.http,
CreateInteractionResponse::Message(
CreateInteractionResponseMessage::new().embed(embed),
),
CreateInteractionResponseFollowup::new().embed(embed),
)
.await
}
Expand Down