/massrole

Add/Remove role(s) from all members of a guild

This endpoint will require a POST request.

Endpoint Headers:

  • bot-token - Token of the Bot [String] (Required)

  • apikey - Your Api Auth Key [String] (Required)

  • guild-id - ID of the guild to be fetched [Snowflake] (Required)

  • channel-id - ID of the channel to send the final response in [Snowflake] (Optional) (See Status 200 for example!)

Endpoint Body Parameters

  • add - Role(s) to add to members [Array of Snowflakes] (Optional*)

  • remove - Role(s) to remove from members [Array of Snowflakes] (Optional*)

Examples:

Data API version required. Must replace <version> with either release or beta.

Bot Designer for Discord

Example usage of /guild/massroll endpoint using BDFD

$httpAddHeader[apikey;<YOUR-API-KEY>]
$httpAddHeader[bot-token;<YOUR-BOT-TOKEN>]
$httpAddHeader[guild-id;1064098700307218463] 
$httpAddHeader[channel-id;1064098702001721486] $c[Optional header]
$httpPost[https://bdfddata.rickyjs.xyz/<version>/guild/massrole;{
"add": ["1064410587293028413"],
"remove": ["1065288607352488017"]
}]


$httpResult OR $httpResult[details]
Discord.js

Example usage of /guild/massrole endpoint using Discord.js

const axios = require('axios');
(async () => {
return await axios.post('https://bdfddata.rickyjs.xyz/<version>/guild/massrole', {
"add": ["1064410587293028413"],
"remove": ["1065288607352488017"]
}, {
headers: {
'apikey': <YOUR-API-KEY>,
'bot-token': <YOUR-BOT-TOKEN>,
'guild-id': '1064098700307218463',
'channel-id': '1064098702001721486' // Optional header
}
}).then(res=>res.data)
})()

Possible Responses (Codes)

Code 200

API succeeded and details were fetched. If a channel-id was provided, a follow-up response will be sent to that channel when the action has completed. The message will consist of completion data results like - Successful role toggles - Failed role toggles (Could have failed for a number of reasons, usually going to be a permissions or role hierarchy error) - Amount of time it took to fully complete the request As stated before, the time the request takes will fluctuate based of the member count and how many rate limits it may hit.

{
  status: 200,
    details: "Operation has started, this could take a while"
}
Code 400

An error occurred that stopped execution.

{
    status: 400
    error: 'Cannot read ...  (This can vary)'
}
Code 401

Invalid bot token was provided.

{
  status: 401,
  details: { message: '401: Unauthorized', code: 0 }
}
Code 404

Guild was not found via DAPI

{
  status: 404,
  details: { message: 'Unknown Guild', code: 10004 } (this can vary)
}

Last updated