Files
Papo/src/events/channelUpdate.ts

20 lines
567 B
TypeScript

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;