BDFDiscordData
  • ℹ️Introduction
  • 👨‍💻[NEW] BDFD x Discord.js Eval
  • 🔏Your Privacy
  • Exclude Header
  • 🥵Support Server
  • 🔗Endpoints
    • /advanced
    • /db
      • /append
      • /delete
      • /deleteAll
      • /get
      • /getAll
      • /set
    • /client
    • /decode
    • /emoji-info
    • /encode
    • /font
    • /foreach
    • /guild
      • /bans
      • /channels
      • /emojis
      • /emoji-delete
      • /event
        • /create
        • /delete
        • /users
        • /modify
      • /invite
      • /members
      • /prune
      • /roles
      • /slash
      • /stickers
    • /jsonkey
    • /map
    • /messages
    • /reaction
      • /add
      • /delete
    • /repeat
    • /setbot
    • /slash
    • /user
Powered by GitBook
On this page
  • Endpoint Headers:
  • Endpoint Body Parameters
  • Examples:
  • Possible Responses (Codes)
  1. Endpoints
  2. /guild
  3. /event

/create

Create an event for a guild

Previous/eventNext/delete

Last updated 4 months ago

This endpoint requires a POST request!

This endpoint supports the header

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)

Endpoint Body Parameters

  • channel_id - the channel id of the scheduled event. [Snowflake] ()

  • entity_metadata - the entity metadata of the scheduled event [Object] (**)

  • name - the name of the scheduled event [String] (Required)

  • privacy_level - the privacy level of the scheduled event [Integer] (Required)

  • scheduled_start_time - the time to schedule the event [ISO8601 timestamp] (Required)

  • scheduled_end_time - the time when the event is scheduled to end [ISO8601 timestamp] (**)

  • description - the description of the scheduled event [String] (Optional)

  • entity_type - the entity type of the scheduled event [Integer] (Required)

  • image - the cover image of the scheduled event [Image Data] (Optional)

* Optional for events with 'entity_type': EXTERNAL

Examples:

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

Bot Designer for Discord

Example usage of /guild/event/create endpoint using BDFD

$httpAddHeader[apikey;<YOUR-API-KEY>]
$httpAddHeader[bot-token;<YOUR-BOT-TOKEN>]
$httpAddHeader[guild-id;1064098700307218463] 
$httpPost[https://bdfddata.rickyjs.xyz/<version>/guild/event/create;{
 "name": "Tainted Love",
      "description": "Star Wars Is Cool",
      "scheduled_start_time": 1683215100,
      "scheduled_end_time": 1683242100,
      "privacy_level": 1,
      "entity_type": 1,
      "entity_metadata": {
        "location": "Alabama"
      }
 }]


$httpResult OR $httpResult[details]
Discord.js

Example usage of /guild/event/create endpoint using Discord.js

const axios = require('axios');
(async () => {
return await axios.post('https://bdfddata.rickyjs.xyz/<version>/guild/event/create', {
 "name": "Tainted Love",
      "description": "Star Wars Is Cool",
      "scheduled_start_time": 1683215100,
      "scheduled_end_time": 1683242100,
      "privacy_level": 1,
      "entity_type": 1,
      "entity_metadata": {
        "location": "Alabama"
      }
}, {
headers: {
'apikey': <YOUR-API-KEY>,
'bot-token': <YOUR-BOT-TOKEN>,
'guild-id: '1064098700307218463',
}
}).then(res=>res.data)
})()

Possible Responses (Codes)

Code 200

API succeeded and details were fetched.

{
 status: 200
 {
  status: 200,
  details:
     {
      id: '1093716999017865326',
      guild_id: '1064098700307218463',
      channel_id: null,
      creator_id: '672215920558604332',
      name: 'Test Event - Ignore This!!!!!',
      description: 'We love you, this is a secret!',
      "pending": false,
      "premium_since": null,

   >  'Read on `Event Objects`: https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object' 
  }
} 
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)
}

** Required for events with'entity_type': EXTERNAL We suggest you read Discord's

🔗
Exclude
Documentation on Event Creation