diff options
Diffstat (limited to 'src')
35 files changed, 661 insertions, 508 deletions
diff --git a/src/commands/dev/__template.ts b/src/commands/dev/__template.ts index 949e04e..be4f7a7 100644 --- a/src/commands/dev/__template.ts +++ b/src/commands/dev/__template.ts @@ -14,7 +14,6 @@ export default class TemplateCommand extends BushCommand { { id: 'required_argument', type: 'string', - prompt: { start: 'What would you like to set your first argument to be?', retry: '{error} Pick a valid argument.', @@ -24,7 +23,6 @@ export default class TemplateCommand extends BushCommand { { id: 'optional_argument', type: 'string', - prompt: { start: 'What would you like to set your second argument to be?', retry: '{error} Pick a valid argument.', diff --git a/src/commands/dev/_testDB.ts b/src/commands/dev/_testDB.ts deleted file mode 100644 index e1fddb4..0000000 --- a/src/commands/dev/_testDB.ts +++ /dev/null @@ -1,25 +0,0 @@ -// import { BushCommand, BushSlashMessage, Global } from '@lib'; -// import { Message } from 'discord.js'; -// import { inspect } from 'util'; - -// export default class TestDurationCommand extends BushCommand { -// public constructor() { -// super('db', { -// aliases: ['db'], -// category: 'dev', -// description: { -// content: '', -// usage: '', -// examples: [''] -// }, -// slash: false, -// hidden: true, -// ownerOnly: true, -// completelyHide: true -// }); -// } - -// override async exec(message: Message | BushSlashMessage): Promise<unknown> { -// return await message.util.reply(await util.codeblock(inspect((await Global.findOne()).environment), 2000, 'js')); -// } -// } diff --git a/src/commands/dev/_testDuration.ts b/src/commands/dev/_testDuration.ts deleted file mode 100644 index 0591518..0000000 --- a/src/commands/dev/_testDuration.ts +++ /dev/null @@ -1,53 +0,0 @@ -// import { BushCommand, BushSlashMessage } from '@lib'; -// import { stripIndents } from 'common-tags'; -// import { Message } from 'discord.js'; - -// export default class TestDurationCommand extends BushCommand { -// public constructor() { -// super('testduration', { -// aliases: ['testduration'], -// category: 'dev', -// description: { -// content: 'Tests duration parsing.', -// usage: 'testduration [reason]', -// examples: ['testduration'] -// }, -// args: [ -// { -// id: 'reason', -// type: 'contentWithDuration', -// match: 'rest', -// prompt: { -// start: 'Enter text and a duration here.', -// retry: '{error} Error parsing duration and text.', -// optional: true -// } -// } -// ], -// slash: true, -// slashOptions: [ -// { -// name: 'reason', -// description: 'Enter text and a duration here.', -// type: 'STRING', -// required: false -// } -// ], -// hidden: true, -// ownerOnly: true -// }); -// } - -// async exec( -// message: Message | BushSlashMessage, -// { reason }: { reason?: { duration: number; contentWithoutTime: string } } -// ): Promise<unknown> { -// const rawDuration = reason.duration; -// const text = reason.contentWithoutTime; -// const humanizedDuration = util.humanizeDuration(rawDuration); -// return await message.util.reply(stripIndents` -// **rawDuration:** ${rawDuration} -// **text:** ${text} -// **humanizedDuration:** ${humanizedDuration}`); -// } -// } diff --git a/src/commands/moderation/_lockdown.ts b/src/commands/moderation/_lockdown.ts index 374e8f1..32dbd5b 100644 --- a/src/commands/moderation/_lockdown.ts +++ b/src/commands/moderation/_lockdown.ts @@ -31,6 +31,7 @@ export default class LockdownCommand extends BushCommand { userPermissions: ['SEND_MESSAGES'] }); } + public override async exec(message: BushMessage | BushSlashMessage, { all }: { all: boolean }): Promise<unknown> { return await message.util.reply('no'); if (!all) { diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index cfa3e31..bda0e2b 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -80,7 +80,8 @@ export default class BanCommand extends BushCommand { userPermissions: ['BAN_MEMBERS'] }); } - override async exec( + + public override async exec( message: BushMessage | BushSlashMessage, { user, diff --git a/src/commands/moderation/evidence.ts b/src/commands/moderation/evidence.ts new file mode 100644 index 0000000..96c3944 --- /dev/null +++ b/src/commands/moderation/evidence.ts @@ -0,0 +1,60 @@ +import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; + +export default class EvidenceCommand extends BushCommand { + public constructor() { + super('evidence', { + aliases: ['evidence'], + category: 'moderation', + description: { + content: 'Add evidence to a modlog case.', + usage: 'evidence <caseID> <evidence>', + examples: ['evidence '] + }, + args: [ + { + id: 'required_argument', + type: 'string', + prompt: { + start: 'What would you like to set your first argument to be?', + retry: '{error} Pick a valid argument.', + optional: false + } + }, + { + id: 'optional_argument', + type: 'string', + prompt: { + start: 'What would you like to set your second argument to be?', + retry: '{error} Pick a valid argument.', + optional: true + } + } + ], + slash: true, + slashOptions: [ + { + name: 'required_argument', + description: 'What would you like to set your first argument to be?', + type: 'STRING', + required: true + }, + { + name: 'optional_argument', + description: 'What would you like to set your second argument to be?', + type: 'STRING', + required: false + } + ], + superUserOnly: true, + ownerOnly: true, + channel: 'guild', + hidden: true, + clientPermissions: ['SEND_MESSAGES'], + userPermissions: ['SEND_MESSAGES'] + }); + } + + public override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { + return await message.util.reply(`${util.emojis.error} Do not use the template command.`); + } +} diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index c425124..2fc133e 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -55,7 +55,7 @@ export default class KickCommand extends BushCommand { }); } - override async exec( + public override async exec( message: BushMessage | BushSlashMessage, { user, reason, force }: { user: BushUser; reason?: string; force: boolean } ): Promise<unknown> { diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts index 8f727a5..84bb5b5 100644 --- a/src/commands/moderation/modlog.ts +++ b/src/commands/moderation/modlog.ts @@ -34,7 +34,7 @@ export default class ModlogCommand extends BushCommand { }); } - private generateModlogInfo(log: ModLog) { + #generateModlogInfo(log: ModLog): string { const modLog = [ `**Case ID**: ${log.id}`, `**Type**: ${log.type.toLowerCase()}`, @@ -43,10 +43,14 @@ export default class ModlogCommand extends BushCommand { ]; if (log.duration) modLog.push(`**Duration**: ${util.humanizeDuration(log.duration)}`); modLog.push(`**Reason**: ${log.reason || 'No Reason Specified.'}`); + if (log.evidence) modLog.push(`**Evidence:** ${log.evidence}`); return modLog.join(`\n`); } - override async exec(message: BushMessage | BushSlashMessage, { search }: { search: BushUser | string }): Promise<unknown> { + public override async exec( + message: BushMessage | BushSlashMessage, + { search }: { search: BushUser | string } + ): Promise<unknown> { const foundUser = search instanceof User ? search : await util.resolveUserAsync(search); if (foundUser) { const logs = await ModLog.findAll({ @@ -59,7 +63,7 @@ export default class ModlogCommand extends BushCommand { if (!logs.length) return message.util.reply(`${util.emojis.error} **${foundUser.tag}** does not have any modlogs.`); const niceLogs: string[] = []; for (const log of logs) { - niceLogs.push(this.generateModlogInfo(log)); + niceLogs.push(this.#generateModlogInfo(log)); } const chunked: string[][] = util.chunk(niceLogs, 3); const embedPages = chunked.map( @@ -76,7 +80,7 @@ export default class ModlogCommand extends BushCommand { if (!entry) return message.util.send(`${util.emojis.error} That modlog does not exist.`); const embed = new MessageEmbed({ title: `Case ${entry.id}`, - description: this.generateModlogInfo(entry), + description: this.#generateModlogInfo(entry), color: util.colors.default }); return await util.buttonPaginate(message, [embed]); diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts index df8e235..9f66558 100644 --- a/src/commands/moderation/mute.ts +++ b/src/commands/moderation/mute.ts @@ -56,6 +56,7 @@ export default class MuteCommand extends BushCommand { userPermissions: ['MANAGE_MESSAGES'] }); } + public override async exec( message: BushMessage | BushSlashMessage, { user, reason, force }: { user: BushUser; reason?: { duration: number; contentWithoutTime: string }; force: boolean } diff --git a/src/commands/moderation/purge.ts b/src/commands/moderation/purge.ts new file mode 100644 index 0000000..f4a53a8 --- /dev/null +++ b/src/commands/moderation/purge.ts @@ -0,0 +1,70 @@ +import { BushCommand, BushMessage } from '../../lib'; + +export default class PurgeCommand extends BushCommand { + public constructor() { + super('purge', { + aliases: ['purge'], + category: 'moderation', + description: { + content: 'A command to mass delete messages.', + usage: 'purge <amount>', + examples: ['Purge 20'] + }, + args: [ + { + id: 'amount', + customType: util.arg.range('integer', 1, 100, true), + prompt: { + start: 'How many messages would you like to purge?', + retry: '{error} Please pick a number between 1 and 100.' + } + }, + { + id: 'bot', + match: 'flag', + flag: '--bot' + }, + { id: 'user', match: 'option', flag: '--user' } + ], + slash: true, + slashOptions: [ + { name: 'amount', description: 'How many messages would you like to purge?', type: 'INTEGER', required: true }, + { + name: 'bot', + description: 'Would you like to only delete messages that are from bots?', + type: 'BOOLEAN', + required: false + } + ], + clientPermissions: ['MANAGE_MESSAGES', 'SEND_MESSAGES', 'EMBED_LINKS'], + userPermissions: ['MANAGE_MESSAGES'], + channel: 'guild' + }); + } + + public override async exec(message: BushMessage, args: { amount: number; bot: boolean }): Promise<unknown> { + if (message.channel.type === 'DM') return message.util.reply(`${util.emojis.error} You cannot run this command in dms.`); + if (args.amount > 100 || args.amount < 1) return message.util.reply(`${util.emojis.error} `); + + const messages = (await message.channel.messages.fetch({ limit: args.amount })).filter((message) => filter(message)); + const filter = (filterMessage: BushMessage): boolean => { + const shouldFilter = new Array<boolean>(); + if (args.bot) { + shouldFilter.push(filterMessage.author.bot); + } + }; + + const purged = await message.channel.bulkDelete(messages, true).catch(() => {}); + if (!purged) return message.util.reply(`${util.emojis.error} Failed to purge messages.`).catch(() => {}); + else { + await message.util + .send(`${util.emojis.success} Successfully purged **${purged.size}** messages.`) + .then(async (purgeMessage: BushMessage) => { + if (!message.util.isSlash) { + await util.sleep(5); + await purgeMessage.delete().catch(() => {}); + } + }); + } + } +} diff --git a/src/commands/moderation/unban.ts b/src/commands/moderation/unban.ts index 522c715..545d75c 100644 --- a/src/commands/moderation/unban.ts +++ b/src/commands/moderation/unban.ts @@ -51,7 +51,7 @@ export default class UnbanCommand extends BushCommand { userPermissions: ['BAN_MEMBERS'] }); } - override async exec( + public override async exec( message: BushMessage | BushSlashMessage, { user, reason }: { user: BushUser; reason?: string } ): Promise<unknown> { diff --git a/src/commands/moderation/unmute.ts b/src/commands/moderation/unmute.ts index 6cdb08b..918c27f 100644 --- a/src/commands/moderation/unmute.ts +++ b/src/commands/moderation/unmute.ts @@ -50,7 +50,8 @@ export default class UnmuteCommand extends BushCommand { userPermissions: ['MANAGE_MESSAGES'] }); } - override async exec( + + public override async exec( message: BushMessage | BushSlashMessage, { user, reason }: { user: BushUser; reason?: string } ): Promise<unknown> { diff --git a/src/commands/moderation/warn.ts b/src/commands/moderation/warn.ts index 1067033..1aa14c3 100644 --- a/src/commands/moderation/warn.ts +++ b/src/commands/moderation/warn.ts @@ -54,6 +54,7 @@ export default class WarnCommand extends BushCommand { userPermissions: ['MANAGE_MESSAGES'] }); } + public override async exec( message: BushMessage | BushSlashMessage, { user, reason, force }: { user: BushUser; reason: string; force: boolean } diff --git a/src/commands/moulberry-bush/level.ts b/src/commands/moulberry-bush/level.ts index fef4538..c202863 100644 --- a/src/commands/moulberry-bush/level.ts +++ b/src/commands/moulberry-bush/level.ts @@ -136,7 +136,7 @@ export default class LevelCommand extends BushCommand { } } - override async exec(message: BushMessage | BushSlashMessage, { user }: { user?: BushUser }): Promise<void> { + public override async exec(message: BushMessage | BushSlashMessage, { user }: { user?: BushUser }): Promise<void> { // await message.reply( // new MessageAttachment( // await this.getImage(user || message.author), diff --git a/src/commands/utilities/hash.ts b/src/commands/utilities/hash.ts index 633a263..16ace93 100644 --- a/src/commands/utilities/hash.ts +++ b/src/commands/utilities/hash.ts @@ -3,7 +3,7 @@ import got from 'got'; import { BushCommand, BushMessage } from '../../lib'; export default class HashCommand extends BushCommand { - constructor() { + public constructor() { super('hash', { aliases: ['hash'], category: 'utilities', diff --git a/src/commands/utilities/youtube.ts b/src/commands/utilities/youtube.ts new file mode 100644 index 0000000..0198173 --- /dev/null +++ b/src/commands/utilities/youtube.ts @@ -0,0 +1,59 @@ +import { VoiceChannel } from 'discord.js'; +import { BushCommand, BushMessage, BushSlashMessage } from '../../lib'; + +export default class YouTubeCommand extends BushCommand { + constructor() { + super('youtube', { + aliases: ['youtube', 'yt'], + category: 'utilities', + description: { + content: "Allows the user to have access to discord's in-app YouTube experiment.", + usage: 'yt <channel>', + examples: ['yt 785281831788216364'] + }, + args: [ + { + id: 'channel', + type: 'voiceChannel', + prompt: { + start: 'What channel would you like to use?', + retry: '{error} Choose a valid voice channel' + } + } + ], + slash: true, + slashOptions: [ + { + name: 'channel', + description: 'What channel would you like to use?', + type: 'CHANNEL', + required: true + } + ], + clientPermissions: ['SEND_MESSAGES'], + userPermissions: ['SEND_MESSAGES'] + }); + } + + public override async exec(message: BushMessage | BushSlashMessage, args: { channel: VoiceChannel }): Promise<unknown> { + if (!args.channel?.id || args.channel?.type != 'GUILD_VOICE') + return await message.util.reply(`${util.emojis.error} Choose a valid voice channel`); + + // @ts-ignore: jank typings + // prettier-ignore + const invite = await this.client.api.channels(args.channel.id).invites.post({ + data: { + validate: null, + max_age: 604800, + max_uses: 0, + target_type: 2, + target_application_id: '755600276941176913', + temporary: false + } + }) + .catch(() => {}); + if (!invite || !invite.code) + return await message.util.reply(`${this.client.util.emojis.error} An error occurred while generating your invite.`); + else return await message.util.send(`https://discord.gg/${invite.code}`); + } +} diff --git a/src/lib/badlinks.json b/src/lib/badlinks.json index 09c3df2..fa5c29c 100644 --- a/src/lib/badlinks.json +++ b/src/lib/badlinks.json @@ -1,70 +1,25 @@ [ - "streammcomunnity.ru", - "stceamcomminity.com", - "steamcommnuninty.com", - "steamcommnunily.com", - "steamncommuniity.com", - "steamcommuniiy.ru", - "steamcomnumity.ru", - "steamoemmunity.com", - "streancommunuty.ru", - "streamcommuninnity.com", - "streamcomnumity.ru", - "stemcommunnilty.com", - "steamsupportpowered.icu", - "staemcomrnunity.store", - "steam-trades.icu", - "facecup.fun", - "fatown.net", - "ultracup.fun", - "iemcup.com", - "esea-mdl.com", - "uspringcup.com", - "denforapasi.cf", - "streamcommulinty.com", - "csskill.com", - "csgo-gifts.com", - "eplcups.com", - "tf2market.store", - "gamerich.xyz", - "anomalygiveaways.pro", - "casefire.fun", - "fineleague.fun", - "stearmcommunnitty.online", - "stearncomminuty.ru", - "stiemcommunitty.ru", - "strearmcommunity.ru", - "steancomunnity.ru", - "cloud9team.space", - "streancommunuty.ru", - "strearmcomunity.ru", - "stermccommunitty.ru", - "steamcommunytu.ru", - "streamcomunity.com", - "steamncommunity.com", - "steamcommunily.uno", "acercup.com", - "xgamercup.com", - "lootxmarket.com", - "roll4tune.com", - "fivetown.net", - "giveavvay.com", - "stermcommuniity.com", - "skinxinfo.net", - "bit-skins.ru", + "affix-cup.ru", + "affix-sport.ru", + "airdrops.tips", "aladdinhub.fun", "allskinz.xyz", "ano-skinspin.xyz", + "anomalygiveaways.pro", "anomalyknifes.xyz", "anomalyskin.xyz", "anomalyskinz.xyz", "anoskinzz.xyz", "berrygamble.com", + "bit-skins.ru", "bitknife.xyz", "bitskines.ru", - "challengeme.vip", + "casefire.fun", "challengeme.in", + "challengeme.vip", "challengme.ru", + "cloud9team.space", "cmepure.com", "cmskillcup.com", "counterpaid.xyz", @@ -85,21 +40,31 @@ "cscoat.eu", "csgo-analyst.com", "csgo-cash.eu", + "csgo-gifts.com", + "csgo-market.ru.com", + "csgo-market.ru.com", "csgo-steamanalyst.net", "csgo-swapskin.com", "csgo-trade.net", "csgo-up.com", "csgobeats.com", + "csgobelieve.ru", "csgocase.one", "csgocashs.com", + "csgocheck.ru.com", "csgocheck.ru", "csgocompetive.com", + "csgocupp.ru.com", + "csgocybersport.ru.com", "csgodetails.info", "csgodreamer.com", "csgodrs.com", + "csgoeasywin.ru.com", "csgoelite.xyz", "csgoencup.com", "csgoevent.xyz", + "csgogift49.xyz", + "csgoindex.ru.com", "csgoindex.ru", "csgoitemdetails.com", "csgoitemsprices.com", @@ -107,6 +72,7 @@ "csgomarble.xyz", "csgomarketplace.net", "csgomarkets.net", + "csgoorun.ru", "csgoprocupgo.com", "csgorcup.com", "csgorose.com", @@ -127,6 +93,7 @@ "csmoneyskinz.xyz", "csmvcecup.com", "csprices.in", + "csskill.com", "csskillpro.xyz", "csskinz.xyz", "cstournament.ru", @@ -136,30 +103,57 @@ "d2faceit.com", "deamonbets.ru", "demonbets.ru", + "denforapasi.cf", "diablobets.com", + "dicsord.gifts", + "discod.gift", + "discord-gifts.com", + "discord-nitro.gifts", + "discord.blog", + "discord.shop", + "discordgivenitro.com", + "discrod.gift", + "disrcod.com", + "dlscord.info", + "dlscord.online", + "dlscord.press", + "dlscord.store", + "dlscord.world", "doatgiveaway.top", "dopeskins.com", - "dota2fight.ru", "dota2fight.net", + "dota2fight.ru", "dota2giveaway.top", "dota2giveaways.top", "dotafights.vip", "dotagiveaway.win", + "dragon-up.online", "earnskinz.xyz", "emeraldbets.ru", + "eplcups.com", + "esea-mdl.com", "esportgaming.ru", "event-games4roll.com", "exchangeuritems.gq", "extraskinscs.xyz", "ezwin24.ru", + "facecup.fun", "faceiteasyleague.ru", + "fatown.net", + "fineleague.fun", "fireopencase.com", + "fivetown.net", "free-skins.ru", + "g2-give.ru", + "g2-give.ru", "game4roll.com", "gameluck.ru", - "games-roll.ru", - "games-roll.ml", + "gamerich.xyz", "games-roll.ga", + "games-roll.ml", + "games-roll.ru", + "gift4keys.com", + "giveavvay.com", "giveawayskin.com", "global-skins.gq", "globalcsskins.xyz", @@ -169,16 +163,20 @@ "gosteamanalyst.com", "gtakey.ru", "hellgiveaway.trade", + "hellstores.xyz", "hltvcsgo.com", "hltvgames.net", + "iemcup.com", + "keys-loot.com", "knifespin.top", - "knifespin.xyz", "knifespin.top", + "knifespin.xyz", "knifespins.xyz", "knifez-roll.xyz", "knifez-win.xyz", "league-csgo.com", "lehatop-01.ru", + "lootxmarket.com", "loungeztrade.com", "lucky-skins.xyz", "makson-gta.ru", @@ -187,25 +185,25 @@ "mvpcup.ru", "mvptournament.com", "mygames4roll.com", + "naviback.ru", "night-skins.com", + "nitros-gift.com", + "nwgwroqr.ru", "ownerbets.com", "playerskinz.xyz", + "pubggift62.xyz", "rangskins.com", + "rave-new.ru", "roll-skins.ru", "roll4knife.xyz", + "roll4tune.com", "rollknfez.xyz", "rollskin-simple.xyz", - "csgo-market.ru.com", - "sakuralive.ru.com", - "csgocupp.ru.com", - "csgoeasywin.ru.com", - "csgocybersport.ru.com", - "csgocheck.ru.com", - "csgo-market.ru.com", - "csgoindex.ru.com", "rushbskins.xyz", "rushskins.xyz", "s1mple-spin.xyz", + "sakuralive.ru.com", + "scale-navi.pp.ru", "simple-knifez.xyz", "simple-win.xyz", "simplegamepro.ru", @@ -214,8 +212,8 @@ "simplewinz.xyz", "skin-index.com", "skin888trade.com", - "skincs-spin.xyz", "skincs-spin.top", + "skincs-spin.xyz", "skinmarkets.net", "skins-hub.top", "skins-info.net", @@ -228,6 +226,7 @@ "skinsplane.com", "skinsplanes.com", "skinsplanets.com", + "skinxinfo.net", "skinxmarket.site", "skinz-spin.top", "skinz-spin.xyz", @@ -235,71 +234,102 @@ "skinzprize.xyz", "skinzspin-cs.xyz", "skinzspinz.xyz", + "sleanmconmunltiy.ru", "spin-games.com", "spin4skinzcs.top", "spin4skinzcs.xyz", "spinforskin.ml", "sponsored-simple.xyz", + "staemcomnrnunitiy.ru.com", + "staemcomrnunity.store", + "staermcrommunity.me", "staffstatsgo.com", "starrygamble.com", "stat-csgo.ru", "stats-cs.ru", + "stceamcomminity.com", "steam-analyst.ru", + "steam-trades.icu", "steamanalysts.com", + "steamcomcunity.ru", + "steamcomminutiu.ru", + "steamcomminutiy.ru", + "steamcomminytiu.com", + "steamcomminytiu.ru", + "steamcomminytu.ru", + "steamcommnunily.com", + "steamcommnuninty.com", + "steamcommnuntiy.com", + "steamcommrutiny.ru", + "steamcommuniiy.ru", + "steamcommunily.uno", + "steamcommunityu.com", + "steamcommunityw.com", + "steamcommunlty.pro", + "steamcommunutiy.com", + "steamcommunytiu.ru", + "steamcommunytu.ru", + "steamcommutiny.com", + "steamcommynitu.ru", + "steamcomnmuituy.com", + "steamcomnumity.ru", + "steamcomrnunity.ru", + "steamcomrrnunity.com", + "steamcomrunity.com", + "steamconmunlty.com", + "steamcormmuntiy.com", "steamgamesroll.ru", + "steamncommuniity.com", + "steamncommunity.com", + "steamnmcomunnity.co", + "steamoemmunity.com", + "steamsupportpowered.icu", + "steancommynity.ru.com", + "steancomnunytu.ru", + "steancomunnity.ru", + "steancomunyiti.ru", + "stearmcommunnitty. |
