diff --git a/package-lock.json b/package-lock.json index 68e4b12..17d0ff9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "mathjs": "^9.3.0", "moment": "^2.29.1", "ms": "^2.1.3", - "onion-lasers": "^1.1.1", + "onion-lasers": "^1.1.0", "relevant-urban": "^2.0.0", "translate-google": "^1.4.3", "weather-js": "^2.0.0" @@ -5140,9 +5140,9 @@ } }, "node_modules/onion-lasers": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/onion-lasers/-/onion-lasers-1.1.2.tgz", - "integrity": "sha512-gQHQCdcfDSLeWFFXMTBCy2PZR/n603B+Q2L3vTj+9T1CmJS7OfO7zoFM5QrTkOY4N5hESboOdJ8eRvPXQgdxDg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/onion-lasers/-/onion-lasers-1.1.1.tgz", + "integrity": "sha512-aX1jZtDMDjXN3N/k5Ca/6N3aQ1ozN6/1iylhbjB9u5xj97KcqhITx8jH5u2JEjUBZRQ3var9PuF1jNz/DrEgdQ==", "dependencies": { "discord.js": "^12.5.3", "glob": "^7.1.6" @@ -11845,9 +11845,9 @@ } }, "onion-lasers": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/onion-lasers/-/onion-lasers-1.1.2.tgz", - "integrity": "sha512-gQHQCdcfDSLeWFFXMTBCy2PZR/n603B+Q2L3vTj+9T1CmJS7OfO7zoFM5QrTkOY4N5hESboOdJ8eRvPXQgdxDg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/onion-lasers/-/onion-lasers-1.1.1.tgz", + "integrity": "sha512-aX1jZtDMDjXN3N/k5Ca/6N3aQ1ozN6/1iylhbjB9u5xj97KcqhITx8jH5u2JEjUBZRQ3var9PuF1jNz/DrEgdQ==", "requires": { "discord.js": "^12.5.3", "glob": "^7.1.6" diff --git a/src/commands/system/admin.ts b/src/commands/system/admin.ts index ba953a7..45ff624 100644 --- a/src/commands/system/admin.ts +++ b/src/commands/system/admin.ts @@ -204,27 +204,6 @@ export default new NamedCommand({ }) }) } - }), - name: new NamedCommand({ - aliases: ["defaultname"], - description: - "Sets the name that the channel will be reset to once no more members are in the channel.", - usage: "()", - run: "Please provide a new voice channel name.", - any: new RestCommand({ - async run({send, guild, message, combined}) { - const voiceChannel = message.member?.voice.channel; - const guildID = guild!.id; - const guildStorage = Storage.getGuild(guildID); - const newName = combined; - - if (!voiceChannel) return send("You are not in a voice channel."); - - guildStorage.channelNames[voiceChannel.id] = newName; - Storage.save(); - return await send(`Set default channel name to "${newName}".`); - } - }) }) } }), diff --git a/src/index.ts b/src/index.ts index 65e7d70..156aeb4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -74,4 +74,3 @@ import "./modules/intercept"; import "./modules/messageEmbed"; import "./modules/guildMemberAdd"; import "./modules/streamNotifications"; -import "./modules/channelDefaults"; diff --git a/src/modules/channelDefaults.ts b/src/modules/channelDefaults.ts deleted file mode 100644 index 5fcb84a..0000000 --- a/src/modules/channelDefaults.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {client} from "../index"; -import {Storage} from "../structures"; - -client.on("voiceStateUpdate", async (before, after) => { - const channel = before.channel!; - const {channelNames} = Storage.getGuild(after.guild.id); - - if (channel?.members.size === 0 && channel?.id in channelNames) { - channel.setName(channelNames[channel.id]); - } -}); diff --git a/src/structures.ts b/src/structures.ts index a9fbe0c..6da13a7 100644 --- a/src/structures.ts +++ b/src/structures.ts @@ -72,7 +72,6 @@ class Guild { public welcomeMessage: string | null; public streamingChannel: string | null; public streamingRoles: {[role: string]: string}; // Role ID: Category Name - public channelNames: {[channel: string]: string}; public members: {[id: string]: Member}; constructor(data?: GenericJSON) { @@ -81,7 +80,6 @@ class Guild { this.welcomeMessage = select(data?.welcomeMessage, null, String); this.streamingChannel = select(data?.streamingChannel, null, String); this.streamingRoles = {}; - this.channelNames = {}; this.members = {}; switch (data?.welcomeType) { @@ -106,16 +104,6 @@ class Guild { } } - if (data?.channelNames) { - for (const id in data.channelNames) { - const name = data.channelNames[id]; - - if (/\d{17,}/g.test(id) && typeof name === "string") { - this.channelNames[id] = name; - } - } - } - if (data?.members) { for (let id in data.members) { if (/\d{17,}/g.test(id)) {