TravBot-v3/src/events/channelCreate.ts

15 lines
485 B
TypeScript
Raw Normal View History

2020-12-15 01:44:28 +00:00
import Event from "../core/event";
import {client} from "../index";
import $ from "../core/lib";
import * as discord from "discord.js";
2020-12-15 01:44:28 +00:00
export default new Event<"channelCreate">({
async on(channel) {
const botGuilds = client.guilds;
if (channel instanceof discord.GuildChannel) {
const createdGuild = await botGuilds.fetch(channel.guild.id);
2020-12-15 07:56:09 +00:00
$.log(`Channel created in '${createdGuild.name}' called '#${channel.name}'`);
2020-12-15 01:44:28 +00:00
}
}
});