Class: Discordrb::Events::MessageEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/events/message.rb

Instance Method Summary collapse

Constructor Details

#initialize(message, bot) ⇒ MessageEvent

Returns a new instance of MessageEvent.



7
8
9
10
# File 'lib/discordrb/events/message.rb', line 7

def initialize(message, bot)
  @bot = bot
  @message = message
end

Instance Method Details

#authorObject Also known as: user



12
# File 'lib/discordrb/events/message.rb', line 12

def author; @message.author; end

#channelObject



14
# File 'lib/discordrb/events/message.rb', line 14

def channel; @message.channel; end

#contentObject Also known as: text



15
# File 'lib/discordrb/events/message.rb', line 15

def content; @message.content; end

#send_message(content) ⇒ Object Also known as: send, message, respond



19
# File 'lib/discordrb/events/message.rb', line 19

def send_message(content); @message.send_message(content); end

#timestampObject



17
# File 'lib/discordrb/events/message.rb', line 17

def timestamp; @message.timestamp; end