Message Object

The message object is a global value passed into the custom command when it's run. It contains information about the message that triggered it such as the command or message containing the trigger word. Here is an example of the layout:

{
  "guild": {
    "id": "622757587489914880",
    "name": "Operarting System",
    "icon": "https://cdn.discordapp.com/icons/622757587489914880/4faeafcf30de330ce7b08b4dd40d616a.webp"
  },
  "channel": {
    "id": "622761218532179968",
    "name": "robit-commands",
    "type": "text"
  },
  "author": {
    "id": "139871249567318017",
    "bot": false,
    "avatar": "https://cdn.discordapp.com/avatars/139871249567318017/6c7e28a3cfa7d3fde9ffc66c8734e45c.png?size=32",
    "nickname": "Peter",
    "username": "Big P",
    "colour": "#f1c40f",
    "roles": [
      {
        "guild": "622757587489914880",
        "id": "666984345055264799",
        "name": "Big P",
        "color": 15844367,
        "hoist": true,
        "rawPosition": 45,
        "permissions": 104324808,
        "managed": false,
        "mentionable": false,
        "deleted": false,
        "createdTimestamp": 1579091859831
      },
      {
        "guild": "622757587489914880",
        "id": "622757587489914880",
        "name": "@everyone",
        "color": 0,
        "hoist": false,
        "rawPosition": 0,
        "permissions": 104193728,
        "managed": false,
        "mentionable": false,
        "deleted": false,
        "createdTimestamp": 1568547379134
      }
    ]
  },
  "content": "!test hello world https://www.youtube.com/watch?v=_htnaGN8eOs",
  "reference": {
    "channelID":"622761218532179968",
    "guildID":"622757587489914880",
    "messageID":"828587624310505513"
  },
  "id": "828587624310505513",
  "timestamp": 1617621084049,
  "attachments": ["https://media.discordapp.net/attachments/622761218532179968/828423074046017546/ahhh.jpg?width=576&height=544"],
  "embeds": [{"title":"Spaghetti Again","type":"rich","description":null,"url":"https://www.youtube.com/watch?v=_htnaGN8eOs","timestamp":null,"color":16711680,"fields":[],"thumbnail":{"url":"https://i.ytimg.com/vi/_htnaGN8eOs/maxresdefault.jpg","proxyURL":"https://images-ext-1.discordapp.net/external/V4xQcbX77M7O021x0z7DCxaWXYxsoWlfLHZILZTcj8U/https/i.ytimg.com/vi/_htnaGN8eOs/maxresdefault.jpg","height":720,"width":1280},"image":null,"author":{"name":"Spaghetti Again","url":"https://www.youtube.com/channel/UC_F3TvFNvFkX5V8d3StkbLQ"},"footer":null}]
}

Field Reference

guild

This is the Discord server that the message was executed in.

channel

The channel that the command was executed in.

author

The User that triggered the custom function

author.roles

embeds

Last updated