OcelotBOT
Search…
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:
1
{
2
"guild": {
3
"id": "622757587489914880",
4
"name": "Operarting System",
5
"icon": "https://cdn.discordapp.com/icons/622757587489914880/4faeafcf30de330ce7b08b4dd40d616a.webp"
6
},
7
"channel": {
8
"id": "622761218532179968",
9
"name": "robit-commands",
10
"type": "text"
11
},
12
"author": {
13
"id": "139871249567318017",
14
"bot": false,
15
"avatar": "https://cdn.discordapp.com/avatars/139871249567318017/6c7e28a3cfa7d3fde9ffc66c8734e45c.png?size=32",
16
"nickname": "Peter",
17
"username": "Big P",
18
"colour": "#f1c40f",
19
"roles": [
20
{
21
"guild": "622757587489914880",
22
"id": "666984345055264799",
23
"name": "Big P",
24
"color": 15844367,
25
"hoist": true,
26
"rawPosition": 45,
27
"permissions": 104324808,
28
"managed": false,
29
"mentionable": false,
30
"deleted": false,
31
"createdTimestamp": 1579091859831
32
},
33
{
34
"guild": "622757587489914880",
35
"id": "622757587489914880",
36
"name": "@everyone",
37
"color": 0,
38
"hoist": false,
39
"rawPosition": 0,
40
"permissions": 104193728,
41
"managed": false,
42
"mentionable": false,
43
"deleted": false,
44
"createdTimestamp": 1568547379134
45
}
46
]
47
},
48
"content": "!test hello world https://www.youtube.com/watch?v=_htnaGN8eOs",
49
"reference": {
50
"channelID":"622761218532179968",
51
"guildID":"622757587489914880",
52
"messageID":"828587624310505513"
53
},
54
"id": "828587624310505513",
55
"timestamp": 1617621084049,
56
"attachments": ["https://media.discordapp.net/attachments/622761218532179968/828423074046017546/ahhh.jpg?width=576&height=544"],
57
"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}]
58
}
Copied!

Field Reference

guild

This is the Discord server that the message was executed in.
Field
Content
id
The ID of the Guild
name
The name of the Guild
icon
The URL of the current Guild Icon

channel

The channel that the command was executed in.
Field
Content
id
The ID of the Channel
name
The name of the Channel
type
The Type of the channel, technically can be one of these values: dm, text, voice, category, news, store, unknown

author

The User that triggered the custom function
Field
Content
id
The ID of the User
bot
true if the user is a bot, as bots are unable to trigger custom functions this is always false
avatar
The URL of the User's current avatar
nickname
The Users nickname in this server, if it isn't set this is blank
username
The Users username
colour
The display colour of the users name, set by the hoist role
roles
An array of roles the User has. Always contains at least one role which is @everyone
content
The raw content of the message
reference
If the message is a reply to another message, the guild, channel and message IDs of that message are here.
id
The message ID
timestamp
The timestamp that the message was sent at, in milliseconds
attachments
An array of URLs attached to this message
embeds
An array of embeds attached to this message

author.roles

Field
Content
guild
The Guild ID that this role belongs to
id
The ID of the role
name
The name of the role
color
The colour of the role, represented as an integer
hoist
Whether or not this role is displayed separately in the user list
rawPosition
The position of the role in the role list
permissions
The bitfield of the role's permissions
managed
Whether the role belongs to an integration
mentionable
Whether or not you can mention the role
deleted
Whether or not the role has been deleted
createdTimestamp
The timestamp the role was created, in milliseconds

embeds

Field
Content
title
The title of the embed
type
Embed type, usually "rich"
description
The text body of the embed
url
The URL that the embed title links to
timestamp
Timestamp set in the embed
color
The colour of the embed, as a decimal
fields
An array of fields
thumbnail
The thumbnail in the embed with direct URL and proxyURL
image
Image attached to the embed
author
The author specifying in the embed as name, url
footer
Embed footer
Last modified 6mo ago