0.0.2 • Published 2 years ago

discord-events v0.0.2

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 years ago

discord-events

Discord In App Events Manage Discord Server

What's New?

  • First release!

Contents

Installation

npm install discord-events

To Install Latest Version Use:

npm install discord-events@latest

Supports Discord.JS V13 & V12

Examples

.getEvents

 const {DiscordEventManager} = require('discord-events')
  const event = new DiscordEventManager(`your bot token :D`, 'your bot ID :D')


  const b = await event.getEvents(`event ID`)

  console.log(b[0].channel_id) //for second event in a server, write b[1] and etc...

.deleteEvent

const {DiscordEventManager} = require('discord-events')
const event = new DiscordEventManager(`your bot token :D`, 'your bot ID :D')


  await event.deleteEvent(`event ID`)

.createEvent

const {DiscordEventManager} = require('discord-events')
const event = new DiscordEventManager(`your bot token :D`, 'your bot ID :D')

//Stage Event | Entity Type : 1
const Stage_Event = await event.createEvent(`guildId`, {
  entity_type: 1, //stage
  channel_id: `stage channel`, //a stage id
  name: `Event 1`, //Event Name
  scheduled_start_time: `2021-11-22T16:30:44+0000`, //ISO 8601 time format
  scheduled_end_time: `2021-11-25T16:30:44+0000`, // OPTIONAL | ISO 8601 timeformat
  description: `Goodbye party jafar` //OPTIONAL
})

//Voice Event | Entity Type : 2
const Stage_Event = await event.createEvent(`guildId`, {
  entity_type: 2, //voice
  channel_id: `voice channel`, //a voice id
  name: `Event 2`, //Event Name
  scheduled_start_time: `2021-11-22T16:30:44+0000`, //ISO 8601 time format
  scheduled_end_time: `2021-11-25T16:30:44+0000`, // OPTIONAL | ISO 8601 timeformat
  description: `Goodbye party jafar` //OPTIONAL
})

//External Event | Entity Type : 3
const Stage_Event = await event.createEvent(`guildId`, {
  entity_type: 3, //external
  name: `Event 2`, //Event Name
  scheduled_start_time: `2021-11-22T16:30:44+0000`, //ISO 8601 time format
  scheduled_end_time: `2021-11-25T16:30:44+0000`, // REQUIRED | ISO 8601 timeformat
  description: `Goodbye party jafar`, //OPTIONAL
  entity_metadata: { 
    location: `at IRAN` //OPTIONAL
  }
})



  

.editEvent

const {DiscordEventManager} = require('discord-events')
const event = new DiscordEventManager(`your bot token :D`, 'your bot ID :D')


  await event.editEvent(`guild ID`, `event ID`, {
    entity_metadata: {
      location: `Arasbaran Forest :|`
    }
  })