Method: Discordrb::Bot#send_temporary_message
- Defined in:
- lib/discordrb/bot.rb
#send_temporary_message(channel, content, timeout, tts = false, embed = nil, attachments = nil, allowed_mentions = nil, message_reference = nil, components = nil) ⇒ Object
Sends a text message to a channel given its ID and the message's content, then deletes it after the specified timeout in seconds.
410 411 412 413 414 415 416 417 418 419 420 |
# File 'lib/discordrb/bot.rb', line 410 def (channel, content, timeout, tts = false, = nil, = nil, allowed_mentions = nil, = nil, components = nil) Thread.new do Thread.current[:discordrb_name] = "#{@current_thread}-temp-msg" = (channel, content, tts, , , allowed_mentions, , components) sleep(timeout) .delete end nil end |