aboutsummaryrefslogtreecommitdiff
path: root/src/commands/utilities
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/utilities')
-rw-r--r--src/commands/utilities/activity.ts8
-rw-r--r--src/commands/utilities/price.ts4
-rw-r--r--src/commands/utilities/reminders.ts4
-rw-r--r--src/commands/utilities/steal.ts6
-rw-r--r--src/commands/utilities/viewRaw.ts4
5 files changed, 13 insertions, 13 deletions
diff --git a/src/commands/utilities/activity.ts b/src/commands/utilities/activity.ts
index 5a56978..52cad26 100644
--- a/src/commands/utilities/activity.ts
+++ b/src/commands/utilities/activity.ts
@@ -163,10 +163,9 @@ export default class ActivityCommand extends BushCommand {
: activityTypeCaster(message, args.activity);
let response: string;
- const invite = await (<any>client).api
- .channels(channel.id)
- .invites.post({
- data: {
+ const invite: any = await client.rest
+ .post(`/channels/${channel.id}/invites`, {
+ body: {
validate: null,
max_age: 604800,
max_uses: 0,
@@ -175,6 +174,7 @@ export default class ActivityCommand extends BushCommand {
temporary: false
}
})
+
.catch((e: Error | DiscordAPIError) => {
if ((e as DiscordAPIError)?.code === 50013) {
response = `${util.emojis.error} I am missing permissions to make an invite in that channel.`;
diff --git a/src/commands/utilities/price.ts b/src/commands/utilities/price.ts
index 2df70b7..ffc121c 100644
--- a/src/commands/utilities/price.ts
+++ b/src/commands/utilities/price.ts
@@ -1,6 +1,6 @@
import { BushCommand, type BushMessage } from '#lib';
import assert from 'assert';
-import { ApplicationCommandOptionType, AutocompleteInteraction, Embed, Permissions } from 'discord.js';
+import { ApplicationCommandOptionType, AutocompleteInteraction, Embed, PermissionFlagsBits } from 'discord.js';
import Fuse from 'fuse.js';
import got from 'got';
@@ -39,7 +39,7 @@ export default class PriceCommand extends BushCommand {
}
],
slash: true,
- clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.EMBED_LINKS], true),
+ clientPermissions: (m) => util.clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks], true),
userPermissions: [],
typing: true
});
diff --git a/src/commands/utilities/reminders.ts b/src/commands/utilities/reminders.ts
index 369a1a5..509da67 100644
--- a/src/commands/utilities/reminders.ts
+++ b/src/commands/utilities/reminders.ts
@@ -1,7 +1,7 @@
import { BushCommand, ButtonPaginator, Reminder, type BushMessage, type BushSlashMessage } from '#lib';
import assert from 'assert';
import { APIEmbed } from 'discord-api-types';
-import { Permissions } from 'discord.js';
+import { PermissionFlagsBits } from 'discord.js';
import { Op } from 'sequelize';
assert(Op);
@@ -15,7 +15,7 @@ export default class RemindersCommand extends BushCommand {
usage: ['reminder'],
examples: ['reminders'],
slash: true,
- clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.EMBED_LINKS]),
+ clientPermissions: (m) => util.clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks]),
userPermissions: []
});
}
diff --git a/src/commands/utilities/steal.ts b/src/commands/utilities/steal.ts
index a963746..820fa89 100644
--- a/src/commands/utilities/steal.ts
+++ b/src/commands/utilities/steal.ts
@@ -1,7 +1,7 @@
import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib';
import assert from 'assert';
import { type ArgumentOptions, type ArgumentType, type ArgumentTypeCaster, type Flag } from 'discord-akairo';
-import { ApplicationCommandOptionType, Permissions } from 'discord.js';
+import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
import _ from 'lodash';
import { URL } from 'url';
@@ -39,8 +39,8 @@ export default class StealCommand extends BushCommand {
],
slash: true,
channel: 'guild',
- clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.MANAGE_EMOJIS_AND_STICKERS]),
- userPermissions: [Permissions.FLAGS.MANAGE_EMOJIS_AND_STICKERS]
+ clientPermissions: (m) => util.clientSendAndPermCheck(m, [PermissionFlagsBits.ManageEmojisAndStickers]),
+ userPermissions: [PermissionFlagsBits.ManageEmojisAndStickers]
});
}
diff --git a/src/commands/utilities/viewRaw.ts b/src/commands/utilities/viewRaw.ts
index fc50e31..ee57e2d 100644
--- a/src/commands/utilities/viewRaw.ts
+++ b/src/commands/utilities/viewRaw.ts
@@ -7,7 +7,7 @@ import {
type BushTextChannel,
type OptionalArgType
} from '#lib';
-import { ApplicationCommandOptionType, ChannelType, Embed, Message, Permissions, type Snowflake } from 'discord.js';
+import { ApplicationCommandOptionType, ChannelType, Embed, Message, PermissionFlagsBits, type Snowflake } from 'discord.js';
export default class ViewRawCommand extends BushCommand {
public constructor() {
@@ -65,7 +65,7 @@ export default class ViewRawCommand extends BushCommand {
],
slash: true,
channel: 'guild',
- clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.EMBED_LINKS], true),
+ clientPermissions: (m) => util.clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks], true),
userPermissions: []
});
}