diff --git a/src/commands/utility/streaminfo.ts b/src/commands/utility/streaminfo.ts index 969e668..c1a0c9d 100644 --- a/src/commands/utility/streaminfo.ts +++ b/src/commands/utility/streaminfo.ts @@ -8,8 +8,15 @@ export default new NamedCommand({ if (streamList.has(userID)) { const stream = streamList.get(userID)!; - stream.description = args.join(" ") || "No description set."; + const description = args.join(" ") || "No description set."; + stream.description = description; stream.update(); + channel.send(`Successfully set the stream description to:`, { + embed: { + description, + color: member!.displayColor + } + }); } else { // Alternatively, I could make descriptions last outside of just one stream. channel.send("You can only use this command when streaming."); diff --git a/src/index.ts b/src/index.ts index 6c917d7..d1c4736 100644 --- a/src/index.ts +++ b/src/index.ts @@ -66,7 +66,7 @@ import "./modules/ready"; import "./modules/presence"; import "./modules/lavalink"; import "./modules/emoteRegistry"; -import "./modules/channelListener"; +import "./modules/systemInfo"; import "./modules/intercept"; import "./modules/messageEmbed"; import "./modules/guildMemberAdd"; diff --git a/src/modules/channelListener.ts b/src/modules/channelListener.ts deleted file mode 100644 index 910d1ab..0000000 --- a/src/modules/channelListener.ts +++ /dev/null @@ -1,20 +0,0 @@ -import {client} from "../index"; -import {GuildChannel} from "discord.js"; - -client.on("channelCreate", async (channel) => { - const botGuilds = client.guilds; - - if (channel instanceof GuildChannel) { - const createdGuild = await botGuilds.fetch(channel.guild.id); - console.log(`Channel created in '${createdGuild.name}' called '#${channel.name}'`); - } -}); - -client.on("channelDelete", async (channel) => { - const botGuilds = client.guilds; - - if (channel instanceof GuildChannel) { - const createdGuild = await botGuilds.fetch(channel.guild.id); - console.log(`Channel deleted in '${createdGuild.name}' called '#${channel.name}'`); - } -}); diff --git a/src/modules/emoteRegistry.ts b/src/modules/emoteRegistry.ts index 88ab099..a3de8bc 100644 --- a/src/modules/emoteRegistry.ts +++ b/src/modules/emoteRegistry.ts @@ -1,7 +1,6 @@ import {client} from "../index"; import FileManager from "./storage"; -import {EmoteRegistryDump, Config} from "../structures"; -import {TextChannel} from "discord.js"; +import {EmoteRegistryDump} from "../structures"; function updateGlobalEmoteRegistry(): void { const data: EmoteRegistryDump = {version: 1, list: []}; @@ -39,43 +38,13 @@ client.on("emojiUpdate", () => { updateGlobalEmoteRegistry(); }); -client.on("guildCreate", (guild) => { - console.log( - `[GUILD JOIN] ${guild.name} (${guild.id}) added the bot. Owner: ${guild.owner!.user.tag} (${ - guild.owner!.user.id - }). Updated emote registry.` - ); - - if (Config.systemLogsChannel) { - const channel = client.channels.cache.get(Config.systemLogsChannel); - - if (channel && channel.type === "text") { - (channel as TextChannel).send( - `TravBot joined: \`${guild.name}\`. The owner of this guild is: \`${guild.owner!.user.tag}\` (\`${ - guild.owner!.user.id - }\`)` - ); - } else { - console.warn(`${Config.systemLogsChannel} is not a valid text channel for system logs!`); - } - } - +client.on("guildCreate", () => { + console.log("Updated emote registry."); updateGlobalEmoteRegistry(); }); -client.on("guildDelete", (guild) => { - console.log(`[GUILD LEAVE] ${guild.name} (${guild.id}) removed the bot. Updated emote registry.`); - - if (Config.systemLogsChannel) { - const channel = client.channels.cache.get(Config.systemLogsChannel); - - if (channel && channel.type === "text") { - (channel as TextChannel).send(`\`${guild.name}\` (\`${guild.id}\`) removed the bot.`); - } else { - console.warn(`${Config.systemLogsChannel} is not a valid text channel for system logs!`); - } - } - +client.on("guildDelete", () => { + console.log("Updated emote registry."); updateGlobalEmoteRegistry(); }); diff --git a/src/modules/systemInfo.ts b/src/modules/systemInfo.ts new file mode 100644 index 0000000..f9a0b64 --- /dev/null +++ b/src/modules/systemInfo.ts @@ -0,0 +1,57 @@ +import {client} from "../index"; +import {GuildChannel, TextChannel} from "discord.js"; +import {Config} from "../structures"; + +client.on("channelCreate", async (channel) => { + const botGuilds = client.guilds; + + if (channel instanceof GuildChannel) { + const createdGuild = await botGuilds.fetch(channel.guild.id); + console.log(`Channel created in '${createdGuild.name}' called '#${channel.name}'`); + } +}); + +client.on("channelDelete", async (channel) => { + const botGuilds = client.guilds; + + if (channel instanceof GuildChannel) { + const createdGuild = await botGuilds.fetch(channel.guild.id); + console.log(`Channel deleted in '${createdGuild.name}' called '#${channel.name}'`); + } +}); + +client.on("guildCreate", (guild) => { + console.log( + `[GUILD JOIN] ${guild.name} (${guild.id}) added the bot. Owner: ${guild.owner!.user.tag} (${ + guild.owner!.user.id + }).` + ); + + if (Config.systemLogsChannel) { + const channel = client.channels.cache.get(Config.systemLogsChannel); + + if (channel && channel.type === "text") { + (channel as TextChannel).send( + `TravBot joined: \`${guild.name}\`. The owner of this guild is: \`${guild.owner!.user.tag}\` (\`${ + guild.owner!.user.id + }\`)` + ); + } else { + console.warn(`${Config.systemLogsChannel} is not a valid text channel for system logs!`); + } + } +}); + +client.on("guildDelete", (guild) => { + console.log(`[GUILD LEAVE] ${guild.name} (${guild.id}) removed the bot.`); + + if (Config.systemLogsChannel) { + const channel = client.channels.cache.get(Config.systemLogsChannel); + + if (channel && channel.type === "text") { + (channel as TextChannel).send(`\`${guild.name}\` (\`${guild.id}\`) removed the bot.`); + } else { + console.warn(`${Config.systemLogsChannel} is not a valid text channel for system logs!`); + } + } +});