1.0.15 • Published 6 days ago
@magicyan/discord-events v1.0.15
Magicyan Discord Events
Install with
npm install @magicyan/discord-events
This lib adds more discord.js specific events
Setup
Create your bot client normally and pass it to the initDiscordEvents function, so that events can be registered
import { Client } from "discord.js";
import { initDiscordEvents } from "@magicyan/discord-events";
const client = new Client({
intents: [/* add your intents ... */]
// set your client options ...
});
initDiscordEvents(client);
How to use
You can create a listener for the event in the same way you create it for standard discord.js events
client.on("guildMemberConnect", (member, channel) => {
console.log(member.displayName, "joined the" channel.name);
})
See below the list of all events
Event | Parameters | Description |
---|---|---|
webhookMessageCreate | message , webhook | Emitted when a webhook message is created. |
guildMemberConnect | member , voiceChannel | Emitted when a member connect to voice channel in a guild. |
guildMemberDisconnect | member , voiceChannel | Emitted when a member disconnect from voice channel in a guild. |
guildMemberMoved | member , executor , oldVoiceChannel , newVoiceChannel | Emitted when a member is moved from one voice channel to another. |
guildMemberTimeoutAdd | member , executor , expireAt , reason | Emitted when a member gets a timeout |
guildMemberTimeoutAdd | member , executor | Emitted when a member has a timeout removed |
userKick | user , executor , reason , guild | Emitted when a user is kicked from the guild |
userBanAdd | user , executor , reason , guild | Emitted when a user is banned from the guild |
userBanRemove | user , executor , reason , guild | Emitted when a user's ban is removed |
extendedRoleCreate | role , executor | Emitted when a role is created |
extendedRoleUpdate | role , changes , executor | Emitted when a role is updated |
extendedRoleDelete | deletedRole , executor | Emitted when a role is deleted |