[READ-ONLY] Mirror of https://github.com/maybeanerd/MagiBot. MagiBot - the community building discord bot that adds joinsounds to your voice channels! discord.gg/2Evcf4T
bot bots community discord gaming hacktoberfest sound
1

Configure Feed

Select the types of activity you want to include in your feed.

fix: remove "update" command

Sebastian Di Luzio (Jun 4, 2022, 3:38 PM +0200) dace7a96 3feb3afb

+1 -56
+1 -3
src/commandHandler.ts
··· 6 6 // eslint-disable-next-line import/no-cycle 7 7 import { queue as _queue } from './commands/old/@queue'; 8 8 import { setup as _setup } from './commands/old/@setup'; 9 - // eslint-disable-next-line import/no-cycle 10 - import { update as _update } from './commands/old/@update'; 11 9 // we allow this cycle once, as the help command also needs to list itself 12 10 import { help } from './commands/old/help'; // eslint-disable-line import/no-cycle 13 11 ··· 30 28 export const commands: { [k: string]: magibotCommand } = { 31 29 _queue, 32 30 _setup, 33 - _update, 31 + 34 32 help, 35 33 vote, 36 34 info,
-53
src/commands/old/@update.ts
··· 1 - import { TextChannel } from 'discord.js'; 2 - import { commandCategories } from '../../types/enums'; 3 - // eslint-disable-next-line import/no-cycle 4 - import { bot } from '../../bot'; 5 - import { magibotCommand } from '../../types/command'; 6 - import { asyncForEach, yesOrNo } from '../../helperFunctions'; 7 - import { getNotChannel, setSettings } from '../../dbHelpers'; 8 - 9 - async function sendUpdate(update: string) { 10 - await asyncForEach(bot.guilds.cache, async (G) => { 11 - if (G.available) { 12 - const cid = await getNotChannel(G.id); 13 - if (cid) { 14 - const channel = G.channels.cache.get(cid) as TextChannel; 15 - if (channel && G.me) { 16 - const perms = channel.permissionsFor(G.me); 17 - if (perms && perms.has('SEND_MESSAGES')) { 18 - if (G.id === '380669498014957569') { 19 - channel.send(`<@&460218236185739264> ${update}`); 20 - } else { 21 - channel.send(update); 22 - } 23 - } 24 - } else { 25 - await setSettings(G.id, { notChannel: undefined }); 26 - } 27 - } 28 - } 29 - }); 30 - } 31 - 32 - export const update: magibotCommand = { 33 - ehelp: () => [], 34 - perm: ['ADMINISTRATOR'], 35 - name: 'update', 36 - main: async function main({ content, message }) { 37 - const confirmed = await yesOrNo( 38 - message, 39 - `Do you want to send the update\n${content}`, 40 - 'Successfully canceled update', 41 - undefined, 42 - 60000, 43 - ); 44 - if (confirmed) { 45 - sendUpdate(content); 46 - message.channel.send(`Successfully sent:\n${content}`); 47 - } 48 - }, 49 - admin: true, 50 - hide: true, 51 - dev: true, 52 - category: commandCategories.util, 53 - };