Discord Elixir v1.1.18 DiscordEx.Client.Helpers.MessageHelper View Source
Bot Message Helpers
Link to this section Summary
Functions
Actionable Mention and DM Message
Actionable Mention and DM Message This checks that an incoming message is private or is a mention to the current user.
Parameters
- payload: Data from the triggered event.
- state: Current state of bot.
Example
MessageHelper.actionable_message_for_me?(payload, state)
#=> true
Parses a message payload which is content leading with ‘!’. Returns a tuple with the command and the message
Parses a message payload which is content leading with provided prefix. Returns a tuple with the command and the message
Link to this section Functions
actionable_message_for?(String.t(), map(), map()) :: boolean()
Actionable Mention and DM Message
This checks that an incoming message is private or is a mention to the defined user.
Parameters
- bot_name: Name of the bot you are using.
- payload: Data from the triggered event.
- state: Current state of bot.
Example
MessageHelper.actionable_message_for?("Mr.Botman", payload, state)
#=> true
actionable_message_for_me?(map(), map()) :: boolean()
Actionable Mention and DM Message This checks that an incoming message is private or is a mention to the current user.
Parameters
- payload: Data from the triggered event.
- state: Current state of bot.
Example
MessageHelper.actionable_message_for_me?(payload, state)
#=> true
Parses a message payload which is content leading with ‘!’. Returns a tuple with the command and the message.
Parameters
- payload: Data from the triggered event.
Example
MessageHelper.msg_command_parse(payload)
#=> {"ping", "me please!"}
Parses a message payload which is content leading with provided prefix. Returns a tuple with the command and the message.
Parameters
- prefix: prefix for your command
- payload: Data from the triggered event.
Example
MessageHelper.msg_command_parse(payload, "!")
#=> {"ping", "me please!"}