API v2 Docs - Announcement Endpoint
The announcement endpoints allows you to create, edit, delete, and list
announcements for a specific guild.
announcement/get
Returns the specified announcement's data.
Example Request Body
{
"guild_id": 375357265198317579,
"announcement_id": "b067378e-2565-4116-aa20-08cc144d1fdb"
}
Example Response
{
"guild_id": 375357265198317579,
"announcement_id": "b067378e-2565-4116-aa20-08cc144d1fdb",
"channel_id": "266666669542342656",
"event_id": "divq9ihqhoq9hbm2tncj8set04_20180317T030000Z",
"event_color": "NONE",
"type": "RECUR",
"hours": 1,
"minutes": 30,
"info": "Event is in 1 hour and thirty minutes!",
"enabled": true,
"info_only: false,
"publish": true,
"subscribers_role": ["everyone", "378479752186560512"],
"subscribers_user": ["130510525770629121"]
}
Supported Values in Request
Key |
Value Type |
Info |
Required |
guild_id |
string |
The Guild ID |
True |
announcement_id |
String |
The ID of the announcement |
True |
Returned Values
Key |
Value Type |
Info |
guild_id |
string |
The Guild ID |
announcement_id |
String |
The ID of the announcement |
channel_id |
String |
ID of the channel the announcement will announce in |
event_id |
String |
ID of the event the announcement is for |
event_color |
String |
Event Color the announcement will check for |
type |
String |
The announcement's type |
hours |
int |
The amount of hours before the event to fire (added to minutes) |
minutes |
int |
The amount of minutes before the event to fire (added to hours) |
info |
String |
Additional info for the announcement |
enabled |
Boolean |
Whether or not the announcement is enabled |
info_only |
Boolean |
Whether or not the announcement will display just the "info" box |
announcements.publish |
Boolean |
Whether or not the announcement will be published if it is posted in a news channel |
subscribers_role |
List(of Strings) |
List of roles subscribed to the announcement |
subscribers_user |
List(of Strings) |
List of users subscribed to the announcement |
announcement/create
Creates a new announcement with the specified information
Example Request Body
{
"guild_id": 266063520112574464,
"channel": "266666669542342656",
"event_id": "divq9ihqhoq9hbm2tncj8set04",
"type": "RECUR",
"hours": 1,
"minutes": 30,
"info": "Recurring type announcement"
}
Example Response
{
"message": "Announcements successfully created",
"id": "b067378e-2565-4116-aa20-08cc144d1fdb"
Supported Values in Request
Key |
Value Type |
Info |
Required |
guild_id |
string |
The Guild ID |
True |
channel |
String |
ID of channel to post announcement in |
True |
type |
String |
The announcement type |
True |
event_id |
String |
ID of event for announcement to check |
Required if type equals "RECUR" or "SPECIFIC" |
event_color |
String |
Color of events to check |
Required if type equals "COLOR" |
hours |
int |
Amount of hours before event to announce (added to minutes) |
True |
minutes |
int |
Amount of minutes before event to announce (added to hours) |
True |
info |
String |
Additional announcement info |
False, required if info_only is present and true |
info_only |
Boolean |
Whether or not to only display the info of the announcement on broadcast |
False |
announcements.publish |
Boolean |
Whether or not the announcement will be published if it is posted in a news channel |
False |
Returned Values
Key |
Value Type |
Info |
message |
String |
Status of Creation |
id |
String |
ID of the new announcement |
announcement/update
Updates an announcement with the specified information
Example Request Body
{
"guild_id": 266063520112574464,
"announcement_id": "b067378e-2565-4116-aa20-08cc144d1fdb",
"channel": "266666669542342656",
"event_id": "divq9ihqhoq9hbm2tncj8set04",
"type": "RECUR",
"hours": 4,
"info": "I just updated this announcement through the API!",
"enabled": true,
"info_only": false,
"publish": true,
}
Example Response
{
"message": "Announcement successfully updated"
}
Supported Values in Request
Key |
Value Type |
Info |
Required |
guild_id |
string |
The Guild ID |
True |
announcement_id |
String |
The ID of the announcement |
True |
channel_id |
String |
ID of the channel the announcement will announce in |
False |
event_id |
String |
ID of the event the announcement is for |
False |
event_color |
String |
Event Color the announcement will check for |
False |
type |
String |
The announcement's type |
False |
hours |
int |
The amount of hours before the event to fire (added to minutes) |
False |
minutes |
int |
The amount of minutes before the event to fire (added to hours) |
False |
info |
String |
Additional info for the announcement |
False |
enabled |
Boolean |
Whether or not the announcement is enabled |
False |
info_only |
Boolean |
Whether or not the announcement will display just the "info" box |
False |
publish |
Boolean |
Whether or not the announcement will be published if it is posted in a news channel |
False |
add_subscribers_role |
List(of Strings) |
List of roles to subscribe to the announcement |
False |
add_subscribers_user |
List(of Strings) |
List of users to subscribe to the announcement |
False |
remove_subscribers_role |
List(of Strings) |
List of roles to unsubscribe from the announcement |
False |
remove_subscribers_user |
List(of Strings) |
List of users to unsubscribe from the announcement |
False |
Returned Values
Key |
Value Type |
Info |
message |
String |
Status of update |
announcement/delete
Deletes the specified announcement if it exists
Example Request Body
{
"guild_id": 266063520112574464,
"announcement_id": "b067378e-2565-4116-aa20-08cc144d1fdb",
}
Example Response
{
"message": "Announcement successfully deleted"
}
Supported Values in Request
Key |
Value Type |
Info |
Required |
guild_id |
string |
The Guild ID |
True |
announcement_id |
String |
The announcement ID |
True |
Returned Values
Key |
Value Type |
Info |
message |
String |
Status of deletion |
announcement/list
Lists the specified amount of announcements from the guild.
Example Request Body
{
"guild_id": 266063520112574464,
"amount": -1,
}
Example Response
{
"announcements": [{
"guild_id": 375357265198317579,
"announcement_id": "b067378e-2565-4116-aa20-08cc144d1fdb",
"channel_id": "266666669542342656",
"event_id": "divq9ihqhoq9hbm2tncj8set04_20180317T030000Z",
"event_color": "NONE",
"type": "RECUR",
"hours": 1,
"minutes": 30,
"info": "Event is in 1 hour and thirty minutes!",
"enabled": true,
"info_only": false,
"publish": true,
"subscribers_role": ["everyone", "378479752186560512"],
"subscribers_user": ["130510525770629121"]
}]
}
Supported Values in Request
Key |
Value Type |
Info |
Required |
guild_id |
string |
The Guild ID |
True |
amount |
int |
Amount of announcements to list, "-1" for all |
True |
Returned Values
Key |
Value Type |
Info |
announcements |
JSON Array |
A list of all announcements returned |
announcements.guild_id |
string |
The Guild ID |
announcements.announcement_id |
String |
The ID of the announcement |
announcements.channel_id |
String |
ID of the channel the announcement will announce in |
announcements.event_id |
String |
ID of the event the announcement is for |
announcements.event_color |
String |
Event Color the announcement will check for |
announcements.type |
String |
The announcement's type |
announcements.hours |
int |
The amount of hours before the event to fire (added to minutes) |
announcements.minutes |
int |
The amount of minutes before the event to fire (added to hours) |
announcements.info |
String |
Additional info for the announcement |
announcements.enabled |
Boolean |
Whether or not the announcement is enabled |
announcements.info_only |
Boolean |
Whether or not the announcement will display just the "info" box |
announcements.publish |
Boolean |
Whether or not the announcement will be published if it is posted in a news channel |
announcements.subscribers_role |
List(of Strings) |
List of roles subscribed to the announcement |
announcements.subscribers_user |
List(of Strings) |
List of users subscribed to the announcement |