Skip to content

Commit

Permalink
#patch removing user perms check, re-add once approved
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaribsin committed Mar 15, 2024
1 parent 3a60328 commit 783fdf0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
25 changes: 15 additions & 10 deletions src/commands/subscribe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,16 @@ const command: Command = {
run: async interaction => {
const subcommand = interaction.options.data[0].name;

if (interaction.guild) {
const user = await interaction.guild.members.fetch(interaction.user.id);
if (!user.permissions.has('ManageMessages')) {
// respond with missing perms, then delete the response after 5s
await interaction.editReply(missingChannelPerms(interaction));
// TODO: re-enable one the bot is approved for priv intents
// if (interaction.guild) {
// const user = await interaction.guild.members.fetch(interaction.user.id);
// if (!user.permissions.has('ManageMessages')) {
// // respond with missing perms, then delete the response after 5s
// await interaction.editReply(missingChannelPerms(interaction));

return;
}
}
// return;
// }
// }

await subcmds[subcommand](interaction);
},
Expand Down Expand Up @@ -212,7 +213,9 @@ async function updates(interaction: CommandInteraction) {
})
.setTitle('Guild Already Subscribed')
.setDescription(
'This guild is already subscribed to war announcements! To prevent spam, only one subscription per type per guild is allowed (feel free to use other subscribe types, however).'
'This guild is already subscribed to war announcements! ' +
'To prevent spam, only one subscription per type per guild is allowed (feel free to use other subscribe types, however). ' +
'\n\nIf you would like to remove the subscription, use the `/subscribe remove` command.'
)
.setFooter({text: FOOTER_MESSAGE})
.setColor(EMBED_COLOUR)
Expand Down Expand Up @@ -291,7 +294,9 @@ async function status(interaction: CommandInteraction) {
})
.setTitle('Guild Already Subscribed')
.setDescription(
'This guild is already subscribed to war status updates! To prevent spam, only one subscription per type per guild is allowed.'
'This guild is already subscribed to war status updates! ' +
'To prevent spam, only one subscription per type per guild is allowed (feel free to use other subscribe types, however). ' +
'\n\nIf you would like to remove the subscription, use the `/subscribe remove` command.'
)
.setFooter({text: FOOTER_MESSAGE})
.setColor(EMBED_COLOUR)
Expand Down
6 changes: 1 addition & 5 deletions src/handlers/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import {Client, GatewayIntentBits} from 'discord.js';

// Init new Discord client
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
],
intents: [GatewayIntentBits.Guilds],
});

export {client};

0 comments on commit 783fdf0

Please sign in to comment.