Method: Discordrb::Message#edit
- Defined in:
- lib/discordrb/data/message.rb
#edit(new_content, new_embeds = nil, new_components = nil) ⇒ Message
Edits this message to have the specified content instead. You can only edit your own messages.
199 200 201 202 203 204 205 |
# File 'lib/discordrb/data/message.rb', line 199 def edit(new_content, = nil, new_components = nil) = (.instance_of?(Array) ? .map(&:to_hash) : [&.to_hash]).compact new_components = new_components&.to_a || [] response = API::Channel.(@bot.token, @channel.id, @id, new_content, [], , new_components) Message.new(JSON.parse(response), @bot) end |