diff --git a/lib/discordrb/bot.rb b/lib/discordrb/bot.rb index 462624a7d..b16b5eb45 100644 --- a/lib/discordrb/bot.rb +++ b/lib/discordrb/bot.rb @@ -418,10 +418,11 @@ def send_message(channel, content, tts = false, embeds = nil, attachments = nil, # @param message_reference [Message, String, Integer, nil] The message, or message ID, to reply to if any. # @param components [View, Array] Interaction components to associate with this message. def send_temporary_message(channel, content, timeout, tts = false, embeds = nil, attachments = nil, allowed_mentions = nil, message_reference = nil, components = nil) + message = send_message(channel, content, tts, embeds, attachments, allowed_mentions, message_reference, components) + Thread.new do Thread.current[:discordrb_name] = "#{@current_thread}-temp-msg" - message = send_message(channel, content, tts, embeds, attachments, allowed_mentions, message_reference, components) sleep(timeout) message.delete end