DISCAL

About Commands Setup Lazy DisCal Dashboard Support Patreon Status Log In

API



v1 Endpoints






Jump





API v1 Docs - Announcement Endpoint

The announcement endpoints allows you to create, edit, delete, and list announcements for a specific guild.



/get

Returns the specified announcement's data.


Example Request Body

				{
				"guild_id": 375357265198317579,
				"id": "b067378e-2565-4116-aa20-08cc144d1fdb"
				}
			

Example Response


				{
				"channel": "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,
				"subscribers_role": ["everyone", "378479752186560512"],
				"subscribers_user": ["130510525770629121"]
				}
			

Supported Values in Request
Key Value Type Info Required
guild_id long The Guild ID True
id String The ID of the announcement True

Returned Values
Key Value Type Info
channel 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
event_color String Event Color the announcement will check for
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
subscribers_role List(of Strings) List of roles subscribed to the announcement
subscribers_user List(of Strings) List of users subscribed to the 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": ""
				}
			

Example Response


				{
				"Message": "Successfully created announcement",
				"id": "b067378e-2565-4116-aa20-08cc144d1fdb"
			

Supported Values in Request
Key Value Type Info Required
guild_id long 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 (leave blank to ignore) True

Returned Values
Key Value Type Info
Message String Status of Creation
id String ID of the new announcement


/update

Updates an announcement with the specified information


Example Request Body

				{
				"guild_id": 266063520112574464,
				"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
				}
			

Example Response


				{
				"Message": "Successfully updated announcement"
				}
			

Supported Values in Request
Key Value Type Info Required
guild_id long The Guild ID True
id String The Announcement ID True
channel String ID of channel to post announcement in False
type String The announcement type False
event_id String ID of event for announcement to check Required if type changed AND equals "RECUR" or "SPECIFIC"
event_color String Color of events to check Required if type changed AND equals "COLOR"
hours int Amount of hours before event to announce (added to minutes) False
minutes int Amount of minutes before event to announce (added to hours) False
info String Additional announcement info False
enabled Boolean Whether or not the announcement is enabled False
info_only Boolean Whether or not it will display just the "info" box False

Returned Values
Key Value Type Info
Message String Status of update


/delete

Deletes the specified announcement if it exists


Example Request Body

				{
				"guild_id": 266063520112574464,
				"id": "b067378e-2565-4116-aa20-08cc144d1fdb",
				}
			

Example Response


				{
				"Message": "Successfully deleted announcement"
				}
			

Supported Values in Request
Key Value Type Info Required
guild_id long The Guild ID True
id String The announcement ID True

Returned Values
Key Value Type Info
Message String Status of deletion


/list

Lists the specified amount of announcements from the guild.


Example Request Body

				{
				"guild_id": 266063520112574464,
				"amount": -1,
				}
			

Example Response


				{
				"amount": 1,
				"announcements": [{
					"id": "b067378e-2565-4116-aa20-08cc144d1fdb",
					"channel": "266666669542342656",
					"event_id": "divq9ihqhoq9hbm2tncj8set04",
					"event_color": "NONE",
					"type": "RECUR",
					"hours": 4,
					"minutes": 30,
					"info": "4 hours and 30 minutes until event!",
					"enabled": true,
					"info_only": false,
					"subscribers_role": ["everyone", "378479752186560512"],
					"subscribers_user": ["130510525770629121"]
				}]
				}
			

Supported Values in Request
Key Value Type Info Required
guild_id long The Guild ID True
amount int Amount of announcements to list, "-1" for all True

Returned Values
Key Value Type Info
amount int Amount of announcements returned
announcements.channel String ID of channel to post announcement in
announcements.type String The announcement type
announcements.event_id String ID of event for announcement to check
announcements.event_color String Color of events to check
announcements.hours int Amount of hours before event to announce (added to minutes)
announcements.minutes int Amount of minutes before event to announce (added to hours)
announcements.info String Additional announcement info.
announcements.enabled Boolean Whether or not the announcement is enabled
announcements.info_only Boolean Whether or not the announcement will only display the "info" box
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