diff options
| author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-23 18:13:05 -0500 |
|---|---|---|
| committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-23 18:13:05 -0500 |
| commit | a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a (patch) | |
| tree | 9b0f8ed8a93c22c90512751e3f2f5937e1925760 /src/commands/moulberry-bush | |
| parent | 5557677f1570eb564a30cfcebb6030235dc84d47 (diff) | |
| download | tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.tar.gz tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.tar.bz2 tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.zip | |
fix discord.js breaking changes, some other stuff
Diffstat (limited to 'src/commands/moulberry-bush')
| -rw-r--r-- | src/commands/moulberry-bush/capePermissions.ts | 6 | ||||
| -rw-r--r-- | src/commands/moulberry-bush/capes.ts | 7 | ||||
| -rw-r--r-- | src/commands/moulberry-bush/giveawayPing.ts | 15 | ||||
| -rw-r--r-- | src/commands/moulberry-bush/moulHammer.ts | 6 | ||||
| -rw-r--r-- | src/commands/moulberry-bush/report.ts | 11 | ||||
| -rw-r--r-- | src/commands/moulberry-bush/rule.ts | 10 | ||||
| -rw-r--r-- | src/commands/moulberry-bush/serverStatus.ts | 5 |
7 files changed, 35 insertions, 25 deletions
diff --git a/src/commands/moulberry-bush/capePermissions.ts b/src/commands/moulberry-bush/capePermissions.ts index c873095..19c1381 100644 --- a/src/commands/moulberry-bush/capePermissions.ts +++ b/src/commands/moulberry-bush/capePermissions.ts @@ -1,5 +1,5 @@ import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; -import { MessageEmbed } from 'discord.js'; +import { ApplicationCommandOptionType, MessageEmbed, Permissions } from 'discord.js'; import got from 'got'; export default class CapePermissionsCommand extends BushCommand { @@ -17,11 +17,11 @@ export default class CapePermissionsCommand extends BushCommand { type: 'string', prompt: 'Who would you like to see the cape permissions of?', retry: '{error} Choose someone to see the capes their available capes.', - slashType: 'STRING' + slashType: ApplicationCommandOptionType.String } ], slash: true, - clientPermissions: (m) => util.clientSendAndPermCheck(m, ['EMBED_LINKS'], true), + clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.EMBED_LINKS], true), userPermissions: [], channel: 'guild' }); diff --git a/src/commands/moulberry-bush/capes.ts b/src/commands/moulberry-bush/capes.ts index 117fd1c..3a956fc 100644 --- a/src/commands/moulberry-bush/capes.ts +++ b/src/commands/moulberry-bush/capes.ts @@ -1,8 +1,9 @@ import { BushCommand, ButtonPaginator, DeleteButton, type BushMessage, type OptionalArgType } from '#lib'; import assert from 'assert'; -import { AutocompleteInteraction, type MessageEmbedOptions } from 'discord.js'; +import { ApplicationCommandOptionType, AutocompleteInteraction, Permissions, type MessageEmbedOptions } from 'discord.js'; import Fuse from 'fuse.js'; import got from 'got'; + assert(Fuse); assert(got); @@ -22,12 +23,12 @@ export default class CapesCommand extends BushCommand { prompt: 'What cape would you like to see?', retry: '{error} Choose a cape to see.', optional: true, - slashType: 'STRING', + slashType: ApplicationCommandOptionType.String, autocomplete: true } ], slash: true, - clientPermissions: (m) => util.clientSendAndPermCheck(m, ['EMBED_LINKS'], true), + clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.EMBED_LINKS], true), userPermissions: [] }); } diff --git a/src/commands/moulberry-bush/giveawayPing.ts b/src/commands/moulberry-bush/giveawayPing.ts index 28f920a..dbbb613 100644 --- a/src/commands/moulberry-bush/giveawayPing.ts +++ b/src/commands/moulberry-bush/giveawayPing.ts @@ -1,4 +1,5 @@ import { AllowedMentions, BushCommand, type BushMessage } from '#lib'; +import { Permissions } from 'discord.js'; export default class GiveawayPingCommand extends BushCommand { public constructor() { @@ -8,8 +9,14 @@ export default class GiveawayPingCommand extends BushCommand { description: 'Pings the giveaway role.', usage: ['giveaway-ping'], examples: ['giveaway-ping'], - clientPermissions: (m) => util.clientSendAndPermCheck(m, ['MANAGE_MESSAGES'], true), - userPermissions: ['MANAGE_GUILD', 'MANAGE_MESSAGES', 'BAN_MEMBERS', 'KICK_MEMBERS', 'VIEW_CHANNEL'], + clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.MANAGE_MESSAGES], true), + userPermissions: [ + Permissions.FLAGS.MANAGE_GUILD, + Permissions.FLAGS.MANAGE_MESSAGES, + Permissions.FLAGS.BAN_MEMBERS, + Permissions.FLAGS.KICK_MEMBERS, + Permissions.FLAGS.VIEW_CHANNEL + ], channel: 'guild', ignoreCooldown: [], ignorePermissions: [], @@ -22,7 +29,7 @@ export default class GiveawayPingCommand extends BushCommand { } public override async exec(message: BushMessage) { - if (!message.member!.permissions.has('MANAGE_GUILD') && !message.member!.user.isOwner()) + if (!message.member!.permissions.has(Permissions.FLAGS.MANAGE_GUILD) && !message.member!.user.isOwner()) await message.util.reply(`${util.emojis.error} You are missing the **MANAGE_GUILD** permission.`); await message.delete().catch(() => {}); @@ -47,7 +54,7 @@ export default class GiveawayPingCommand extends BushCommand { content: '🎉 <@&767782793261875210> Giveaway.\n\n<:mad:783046135392239626> Spamming, line breaking, gibberish etc. disqualifies you from winning. We can and will ban you from giveaways. Winners will all be checked and rerolled if needed.', username: `${message.member.nickname || message.author.username}`, - avatarURL: message.author.avatarURL({ dynamic: true }), + avatarURL: message.author.avatarURL(), allowedMentions: AllowedMentions.roles() }); */ } diff --git a/src/commands/moulberry-bush/moulHammer.ts b/src/commands/moulberry-bush/moulHammer.ts index 6d87571..4cf3f35 100644 --- a/src/commands/moulberry-bush/moulHammer.ts +++ b/src/commands/moulberry-bush/moulHammer.ts @@ -1,5 +1,5 @@ import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; -import { MessageEmbed } from 'discord.js'; +import { ApplicationCommandOptionType, MessageEmbed, Permissions } from 'discord.js'; export default class MoulHammerCommand extends BushCommand { public constructor() { @@ -16,13 +16,13 @@ export default class MoulHammerCommand extends BushCommand { type: 'user', prompt: 'What user would you like to moul hammer?', retry: '{error} Choose a valid user to moul hammer', - slashType: 'USER' + slashType: ApplicationCommandOptionType.User } ], slash: true, slashGuilds: ['516977525906341928'], restrictedGuilds: ['516977525906341928'], - clientPermissions: (m) => util.clientSendAndPermCheck(m, ['EMBED_LINKS'], true), + clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.EMBED_LINKS], true), userPermissions: [] }); } diff --git a/src/commands/moulberry-bush/report.ts b/src/commands/moulberry-bush/report.ts index 90abc97..f2c10bc 100644 --- a/src/commands/moulberry-bush/report.ts +++ b/src/commands/moulberry-bush/report.ts @@ -1,7 +1,8 @@ import { AllowedMentions, BushCommand, type ArgType, type BushMessage } from '#lib'; import assert from 'assert'; -import { MessageEmbed } from 'discord.js'; +import { ApplicationCommandOptionType, MessageEmbed, Permissions } from 'discord.js'; import moment from 'moment'; + assert(moment); export default class ReportCommand extends BushCommand { @@ -19,7 +20,7 @@ export default class ReportCommand extends BushCommand { type: 'member', prompt: 'Who would you like to report?', retry: '{error} Choose a valid user to report.', - slashType: 'USER' + slashType: ApplicationCommandOptionType.User }, { id: 'evidence', @@ -29,11 +30,11 @@ export default class ReportCommand extends BushCommand { prompt: 'What did the user do wrong?', retry: '{error} Provide evidence.', optional: true, - slashType: 'STRING' + slashType: ApplicationCommandOptionType.String } ], slash: true, - clientPermissions: (m) => util.clientSendAndPermCheck(m, ['EMBED_LINKS'], true), + clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.EMBED_LINKS], true), userPermissions: [], channel: 'guild' }); @@ -66,7 +67,7 @@ export default class ReportCommand extends BushCommand { .setTimestamp() .setAuthor({ name: `Report From: ${message.author.tag}`, - iconURL: message.author.avatarURL({ dynamic: true }) ?? undefined + iconURL: message.author.avatarURL() ?? undefined }) .setTitle('New Report') .setColor(util.colors.red) diff --git a/src/commands/moulberry-bush/rule.ts b/src/commands/moulberry-bush/rule.ts index 28483a4..1bfcfe7 100644 --- a/src/commands/moulberry-bush/rule.ts +++ b/src/commands/moulberry-bush/rule.ts @@ -1,5 +1,5 @@ import { AllowedMentions, BushCommand, BushSlashMessage, type BushMessage, type OptionalArgType } from '#lib'; -import { MessageEmbed } from 'discord.js'; +import { ApplicationCommandOptionType, MessageEmbed, Permissions } from 'discord.js'; const rules = [ { @@ -68,7 +68,7 @@ export default class RuleCommand extends BushCommand { prompt: 'What rule would you like to have cited?', retry: '{error} Choose a valid rule.', optional: true, - slashType: 'INTEGER', + slashType: ApplicationCommandOptionType.Integer, minValue: 1, maxValue: rules.length }, @@ -79,13 +79,13 @@ export default class RuleCommand extends BushCommand { prompt: 'What user would you like to mention?', retry: '{error} Choose a valid user to mention.', optional: true, - slashType: 'USER' + slashType: ApplicationCommandOptionType.User } ], slash: true, slashGuilds: ['516977525906341928'], channel: 'guild', - clientPermissions: (m) => util.clientSendAndPermCheck(m, ['EMBED_LINKS'], true), + clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.EMBED_LINKS], true), userPermissions: [], restrictedGuilds: ['516977525906341928'] }); @@ -99,7 +99,7 @@ export default class RuleCommand extends BushCommand { .setColor('#ef3929') .setFooter({ text: `Triggered by ${message.author.tag}`, - iconURL: message.author.avatarURL({ dynamic: true }) ?? undefined + iconURL: message.author.avatarURL() ?? undefined }) .setTimestamp(); diff --git a/src/commands/moulberry-bush/serverStatus.ts b/src/commands/moulberry-bush/serverStatus.ts index 3d8e780..28b38a5 100644 --- a/src/commands/moulberry-bush/serverStatus.ts +++ b/src/commands/moulberry-bush/serverStatus.ts @@ -1,7 +1,8 @@ import { BushCommand, type BushMessage } from '#lib'; import assert from 'assert'; -import { MessageEmbed } from 'discord.js'; +import { MessageEmbed, Permissions } from 'discord.js'; import got from 'got'; + assert(got); export default class ServerStatusCommand extends BushCommand { @@ -12,7 +13,7 @@ export default class ServerStatusCommand extends BushCommand { description: "Gives the status of moulberry's server", usage: ['server-status'], examples: ['server-status', 'ss'], - clientPermissions: (m) => util.clientSendAndPermCheck(m, ['EMBED_LINKS'], true), + clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.EMBED_LINKS], true), userPermissions: [], slash: true }); |
