1.2.1 • Published 11 months ago
@magicyan/discord-events v1.2.1
Magicyan Discord Events
Install with
npm install @magicyan/discord-events
pnpm install @magicyan/discord-events
yarn add @magicyan/discord-events
bun install @magicyan/discord-eventsThis 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 |
1.2.0
1 year ago
1.2.1
11 months ago
1.1.1
1 year ago
1.1.0
1 year ago
1.0.16
1 year ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago