Skip to content

Commit

Permalink
disable dms for locked commands
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Oct 30, 2023
1 parent b99ade9 commit 39e8774
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/commands/bot/botban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export const command: SlashCommand = {
.setRequired(true),
),
)
.setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages),
.setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages)
.setDMPermission(false),
execute: new Collection<string, SlashCommandI>()
.set("edit", async (interaction: ChatInputCommandInteraction) => {
const isAdding = interaction.options.getString("action", true) == "add";
Expand Down
3 changes: 2 additions & 1 deletion src/commands/bot/embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export const command: SlashCommand = {
.setDescription("Add a thumbnail to the top right corner of the embed")
.setRequired(false),
)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction: ChatInputCommandInteraction) {
if (!interaction.options.getString("title") && !interaction.options.getString("description")) {
return await interaction.reply({
Expand Down
6 changes: 4 additions & 2 deletions src/commands/bot/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ export const command: SlashCommand = {
data: new SlashCommandBuilder()
.setName("logs")
.setDescription("Get logs of the bot.")
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction: ChatInputCommandInteraction) {
if (!interaction.hasPermission("dev")) return;

await interaction.reply({ files: [logConstructor(interaction.client)] }).catch(console.error);
await interaction.deferReply();
await interaction.editReply({ files: [logConstructor(interaction.client)] }).catch(console.error);
},
};
3 changes: 2 additions & 1 deletion src/commands/developer/eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export const command: SlashCommand = {
.addStringOption((option) =>
option.setName("code").setDescription("The code to evaluate.").setRequired(true),
)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction: ChatInputCommandInteraction) {
if (!interaction.hasPermission("dev")) return;
const clean = async (text: any, client: Client): Promise<string> => {
Expand Down
3 changes: 2 additions & 1 deletion src/commands/developer/restart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export const command: SlashCommand = {
data: new SlashCommandBuilder()
.setName("restart")
.setDescription("Restarts the bot.")
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction: ChatInputCommandInteraction) {
if (!interaction.hasPermission("dev")) return;

Expand Down
3 changes: 2 additions & 1 deletion src/commands/developer/shutdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export const command: SlashCommand = {
data: new SlashCommandBuilder()
.setName("shutdown")
.setDescription("Shuts down the bot.")
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction: ChatInputCommandInteraction) {
if (!interaction.hasPermission("dev")) return;
await interaction.reply({
Expand Down
3 changes: 2 additions & 1 deletion src/commands/developer/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export const command: SlashCommand = {
.setDescription("Message to show after the bot activity")
.setRequired(true),
)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction: ChatInputCommandInteraction) {
if (!interaction.hasPermission("dev")) return;

Expand Down
3 changes: 2 additions & 1 deletion src/commands/fun/reply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const command: SlashCommand = {
.addStringOption((option) =>
option.setName("message").setDescription("Message ID to reply to").setRequired(true),
)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction: ChatInputCommandInteraction) {
if (!interaction.hasPermission("dev")) return;

Expand Down
3 changes: 2 additions & 1 deletion src/commands/fun/say.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export const command: SlashCommand = {
.setDescription("The funny thing you want the bot to say.")
.setRequired(true),
)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction: ChatInputCommandInteraction) {
if (!interaction.hasPermission("dev")) return;

Expand Down

0 comments on commit 39e8774

Please sign in to comment.