Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

Commit 84a13e0

Browse files
Added permission on context menu commands
1 parent bef41ee commit 84a13e0

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "theseer",
3-
"version": "3.0.166",
3+
"version": "3.0.167",
44
"description": "A bot that monitors other bots.",
55
"main": "build/Main.js",
66
"repository": "https://github.com/RagnarLothbrok-Odin/TheSeer-Discord.git",

src/context/Add.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { Client, ContextMenu, Discord } from 'discordx';
2-
import { ApplicationCommandType, EmbedBuilder, UserContextMenuCommandInteraction } from 'discord.js';
2+
import {
3+
ApplicationCommandType,
4+
EmbedBuilder,
5+
PermissionsBitField,
6+
UserContextMenuCommandInteraction,
7+
} from 'discord.js';
38
import WatchedBots from '../mongo/schemas/WatchedBots.js';
49
import { updateActivity } from '../utils/Util.js';
510

@@ -14,6 +19,7 @@ export class AddContext {
1419
@ContextMenu({
1520
name: 'Add to monitor list',
1621
type: ApplicationCommandType.User,
22+
defaultMemberPermissions: [PermissionsBitField.Flags.ManageGuild],
1723
})
1824
async userHandler(interaction: UserContextMenuCommandInteraction, client: Client): Promise<void> {
1925
if (interaction.targetUser.id === client.user?.id) {

src/context/Remove.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { Client, ContextMenu, Discord } from 'discordx';
2-
import { ApplicationCommandType, EmbedBuilder, UserContextMenuCommandInteraction } from 'discord.js';
2+
import {
3+
ApplicationCommandType,
4+
EmbedBuilder,
5+
PermissionsBitField,
6+
UserContextMenuCommandInteraction,
7+
} from 'discord.js';
38
import WatchedBots from '../mongo/schemas/WatchedBots.js';
49
import { updateActivity } from '../utils/Util.js';
510

@@ -14,6 +19,7 @@ export class RemoveContext {
1419
@ContextMenu({
1520
name: 'Remove from monitor list',
1621
type: ApplicationCommandType.User,
22+
defaultMemberPermissions: [PermissionsBitField.Flags.ManageGuild],
1723
})
1824
async userHandler(interaction: UserContextMenuCommandInteraction, client: Client): Promise<void> {
1925
const status = await WatchedBots.findOne({ GuildId: interaction.guild?.id });

0 commit comments

Comments
 (0)