aboutsummaryrefslogtreecommitdiff
path: root/src/commands/leveling
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-01-31 19:20:39 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-01-31 19:20:39 -0500
commitbab76f38a17c62f8c1477172fe1bc9428efb3843 (patch)
tree9aee5ed7b54e74735ff417820427c9d2efa984f4 /src/commands/leveling
parent78ab3362a52578d0bcada903732f147747c609df (diff)
downloadtanzanite-bab76f38a17c62f8c1477172fe1bc9428efb3843.tar.gz
tanzanite-bab76f38a17c62f8c1477172fe1bc9428efb3843.tar.bz2
tanzanite-bab76f38a17c62f8c1477172fe1bc9428efb3843.zip
fixes, and breaking changes
Diffstat (limited to 'src/commands/leveling')
-rw-r--r--src/commands/leveling/leaderboard.ts4
-rw-r--r--src/commands/leveling/level.ts6
-rw-r--r--src/commands/leveling/levelRoles.ts6
-rw-r--r--src/commands/leveling/setLevel.ts4
-rw-r--r--src/commands/leveling/setXp.ts4
5 files changed, 12 insertions, 12 deletions
diff --git a/src/commands/leveling/leaderboard.ts b/src/commands/leveling/leaderboard.ts
index 3a00036..eb8b90c 100644
--- a/src/commands/leveling/leaderboard.ts
+++ b/src/commands/leveling/leaderboard.ts
@@ -1,5 +1,5 @@
import { BushCommand, ButtonPaginator, Level, type ArgType, type BushMessage, type BushSlashMessage } from '#lib';
-import { ApplicationCommandOptionType, Embed, Permissions } from 'discord.js';
+import { ApplicationCommandOptionType, Embed, PermissionFlagsBits } from 'discord.js';
export default class LeaderboardCommand extends BushCommand {
public constructor() {
@@ -32,7 +32,7 @@ export default class LeaderboardCommand extends BushCommand {
if (!(await message.guild.hasFeature('leveling')))
return await message.util.reply(
`${util.emojis.error} This command can only be run in servers with the leveling feature enabled.${
- message.member?.permissions.has(Permissions.FLAGS.MANAGE_GUILD)
+ message.member?.permissions.has(PermissionFlagsBits.ManageGuild)
? ` You can toggle features using the \`${util.prefix(message)}features\` command.`
: ''
}`
diff --git a/src/commands/leveling/level.ts b/src/commands/leveling/level.ts
index 18648e8..271c3f6 100644
--- a/src/commands/leveling/level.ts
+++ b/src/commands/leveling/level.ts
@@ -12,7 +12,7 @@ import {
import { SimplifyNumber } from '@notenoughupdates/simplify-number';
import assert from 'assert';
import canvas from 'canvas';
-import { ApplicationCommandOptionType, MessageAttachment, Permissions } from 'discord.js';
+import { ApplicationCommandOptionType, MessageAttachment, PermissionFlagsBits } from 'discord.js';
import got from 'got';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
@@ -51,7 +51,7 @@ export default class LevelCommand extends BushCommand {
if (!(await message.guild.hasFeature('leveling')))
return await message.util.reply(
`${util.emojis.error} This command can only be run in servers with the leveling feature enabled.${
- message.member?.permissions.has(Permissions.FLAGS.MANAGE_GUILD)
+ message.member?.permissions.has(PermissionFlagsBits.ManageGuild)
? ` You can toggle features using the \`${util.prefix(message)}features\` command.`
: ''
}`
@@ -96,7 +96,7 @@ export default class LevelCommand extends BushCommand {
ctx.fillRect(0, 0, levelCard.width, levelCard.height);
// Draw avatar
const AVATAR_SIZE = 128;
- const avatarBuffer = await got.get(user.displayAvatarURL({ format: 'png', size: AVATAR_SIZE })).buffer();
+ const avatarBuffer = await got.get(user.displayAvatarURL({ extension: 'png', size: AVATAR_SIZE })).buffer();
const avatarImage = new canvas.Image();
avatarImage.src = avatarBuffer;
const imageTopCoord = levelCard.height / 2 - AVATAR_SIZE / 2;
diff --git a/src/commands/leveling/levelRoles.ts b/src/commands/leveling/levelRoles.ts
index 115ace1..c15ebcb 100644
--- a/src/commands/leveling/levelRoles.ts
+++ b/src/commands/leveling/levelRoles.ts
@@ -1,6 +1,6 @@
import { AllowedMentions, BushCommand, type ArgType, type BushMessage, type BushSlashMessage, type OptionalArgType } from '#lib';
import assert from 'assert';
-import { ApplicationCommandOptionType, Permissions } from 'discord.js';
+import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
export default class LevelRolesCommand extends BushCommand {
public constructor() {
@@ -33,8 +33,8 @@ export default class LevelRolesCommand extends BushCommand {
],
slash: true,
channel: 'guild',
- clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.MANAGE_ROLES]),
- userPermissions: [Permissions.FLAGS.MANAGE_GUILD, Permissions.FLAGS.MANAGE_ROLES]
+ clientPermissions: (m) => util.clientSendAndPermCheck(m, [PermissionFlagsBits.ManageRoles]),
+ userPermissions: [PermissionFlagsBits.ManageGuild, PermissionFlagsBits.ManageRoles]
});
}
diff --git a/src/commands/leveling/setLevel.ts b/src/commands/leveling/setLevel.ts
index 29f36e0..1016280 100644
--- a/src/commands/leveling/setLevel.ts
+++ b/src/commands/leveling/setLevel.ts
@@ -1,5 +1,5 @@
import { AllowedMentions, BushCommand, Level, type ArgType, type BushMessage, type BushSlashMessage } from '#lib';
-import { ApplicationCommandOptionType, Permissions } from 'discord.js';
+import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
export default class SetLevelCommand extends BushCommand {
public constructor() {
@@ -30,7 +30,7 @@ export default class SetLevelCommand extends BushCommand {
slash: true,
channel: 'guild',
clientPermissions: (m) => util.clientSendAndPermCheck(m),
- userPermissions: [Permissions.FLAGS.ADMINISTRATOR]
+ userPermissions: [PermissionFlagsBits.Administrator]
});
}
diff --git a/src/commands/leveling/setXp.ts b/src/commands/leveling/setXp.ts
index 721f28f..a86c58a 100644
--- a/src/commands/leveling/setXp.ts
+++ b/src/commands/leveling/setXp.ts
@@ -1,5 +1,5 @@
import { AllowedMentions, BushCommand, Level, type ArgType, type BushMessage, type BushSlashMessage } from '#lib';
-import { ApplicationCommandOptionType, Permissions } from 'discord.js';
+import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
export default class SetXpCommand extends BushCommand {
public constructor() {
@@ -31,7 +31,7 @@ export default class SetXpCommand extends BushCommand {
slash: true,
channel: 'guild',
clientPermissions: (m) => util.clientSendAndPermCheck(m),
- userPermissions: [Permissions.FLAGS.ADMINISTRATOR]
+ userPermissions: [PermissionFlagsBits.Administrator]
});
}