Add events module with dashboard UI, scheduling, signups, and settings updates; extend env/readme.
This commit is contained in:
19
src/events/channelUpdate.ts
Normal file
19
src/events/channelUpdate.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { GuildChannel } from 'discord.js';
|
||||
import { EventHandler } from '../utils/types';
|
||||
import { context } from '../config/context';
|
||||
|
||||
const event: EventHandler = {
|
||||
name: 'channelUpdate',
|
||||
execute(oldChannel: GuildChannel, newChannel: GuildChannel) {
|
||||
if (!newChannel.guild) return;
|
||||
const nameChanged = oldChannel.name !== newChannel.name;
|
||||
if (nameChanged) {
|
||||
context.logging.logSystem(
|
||||
newChannel.guild,
|
||||
`Channel umbenannt: ${oldChannel.name} -> ${newChannel.name} (${newChannel.id})`
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default event;
|
||||
Reference in New Issue
Block a user