Skip to content

Commit

Permalink
Merge branch 'guildScheduledEvents' into development
Browse files Browse the repository at this point in the history
ArturBieniek4 committed Nov 28, 2024
1 parent 43f67cc commit ea1e458
Showing 2 changed files with 69 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ import {
} from './modules/roleReactionManager.js';
import { giveAutorole, setAutoroleEnabled } from './modules/setupAutorole.js';
import { editWelcomeMessage, sendWelcomeMessage } from './modules/welcomeMessage.js';
import { logGuildEventCreated, logGuildEventDeleted, logGuildEventUserAdd, logGuildEventUserRemove } from './modules/guildEvents.js'

const client = new Client({
intents: [
@@ -21,7 +22,8 @@ const client = new Client({
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessageReactions
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildScheduledEvents
],
partials: [Partials.Message, Partials.Channel, Partials.Reaction]
});
@@ -73,3 +75,23 @@ client.on(Events.InteractionCreate, async interaction => {
}
}
});

client.on(Events.GuildScheduledEventCreate, async event => {
logGuildEventCreated(event);
});

client.on(Events.GuildScheduledEventDelete, async event => {
logGuildEventDeleted(event);
});

client.on(Events.GuildScheduledEventUpdate, async event => {
console.log(event);
});

client.on(Events.GuildScheduledEventUserAdd, async event => {
logGuildEventUserAdd(event);
});

client.on(Events.GuildScheduledEventUserRemove, async event => {
logGuildEventUserRemove(event);
});
46 changes: 46 additions & 0 deletions src/modules/guildEvents.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { GuildScheduledEvent } from "discord.js";

/**
* Function to log scheduled guild events
* @param event Object with all information about scheduled event
* @returns {void}
*/
export const logGuildEventCreated = async (event: GuildScheduledEvent) => {
console.log(event);
};

/**
* Function to log scheduled guild events
* @param event Object with all information about scheduled event
* @returns {void}
*/
export const logGuildEventDeleted = async (event: GuildScheduledEvent) => {
console.log(event);
};

/**
* Function to log scheduled guild events
* @param event Object with all information about scheduled event
* @returns {void}
*/
export const logGuildEventUpdated = async (event: GuildScheduledEvent) => {
console.log(event);
};

/**
* Function to log scheduled guild events
* @param event Object with all information about scheduled event
* @returns {void}
*/
export const logGuildEventUserAdd = async (event: GuildScheduledEvent) => {
console.log(event);
};

/**
* Function to log scheduled guild events
* @param event Object with all information about scheduled event
* @returns {void}
*/
export const logGuildEventUserRemove = async (event: GuildScheduledEvent) => {
console.log(event);
};

0 comments on commit ea1e458

Please sign in to comment.