Skip to content

Commit

Permalink
Ping filter all replies
Browse files Browse the repository at this point in the history
  • Loading branch information
XboxBedrock authored Aug 29, 2024
1 parent 40aac61 commit d01fdab
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
31 changes: 15 additions & 16 deletions src/commands/blunder.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ export default new Command({

const canManage = message.member
? GuildMember.hasRole(
staffMember,
//Broadly widening permissions for blunder command
[
globalThis.client.roles.STAFF,
globalThis.client.roles.BUILD_TEAM_STAFF,
globalThis.client.roles.TEAM_OWNER_STAFF
],
client
)
staffMember,
//Broadly widening permissions for blunder command
[
globalThis.client.roles.STAFF,
globalThis.client.roles.BUILD_TEAM_STAFF,
globalThis.client.roles.TEAM_OWNER_STAFF
],
client
)
: false

if (subcommand == "commit") {
Expand Down Expand Up @@ -153,9 +153,10 @@ export default new Command({
blunder.description = description

const msg = await channel.send(
`\`unknown\` days since ${
blunder.role ? (await blunder.roleToTeam(client)) + " " : ""
}${blunder.description}`
{
content: `\`unknown\` days since ${blunder.role ? (await blunder.roleToTeam(client)) + " " : ""
}${blunder.description}`, allowedMentions: { parse: [] }
}
)
blunder.message = msg.id
await blunder.save()
Expand Down Expand Up @@ -198,10 +199,8 @@ export default new Command({
blunders
.map(
blunder =>
`[**${blunder.id}:**](https://discord.com/channels/${
staffMember.guild.id
}/${blunder.channel}/${blunder.message}) days since ${
blunder.role ? `<@&${blunder.role}> ` : ""
`[**${blunder.id}:**](https://discord.com/channels/${staffMember.guild.id
}/${blunder.channel}/${blunder.message}) days since ${blunder.role ? `<@&${blunder.role}> ` : ""
}${blunder.description}`
)
.join("\n") || "None :(",
Expand Down
5 changes: 4 additions & 1 deletion src/commands/tasks.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ export default new Command({
if (!tasks.length) return message.sendErrorMessage("noTasks")

const report = tasks.map(task => `• ${task.title}`).join("\n")
await channel.send(`Task report from <@${message.member.id}>:\n\n${report}`)
await channel.send({
content: `Task report from <@${message.member.id}>:\n\n${report}`,
allowedMentions: { parse: [] }
})

for (const task of tasks) {
task.status = "reported"
Expand Down
5 changes: 4 additions & 1 deletion src/entities/Reminder.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ export default class Reminder extends typeorm.BaseEntity {
const channel = client.channels.cache.get(this.channel) as TextChannel
if (!channel) return

channel.send(this.message)
channel.send({
content: this.message,
allowedMentions: { parse: ['users', 'roles'] }
})
const tempReminderTimeout = client.reminderTimeouts.get(this.id)
if (tempReminderTimeout) {
const tempNext = tempReminderTimeout.next(new Date(Date.now()))
Expand Down
8 changes: 6 additions & 2 deletions src/struct/discord/Response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,14 @@ export default class Response {
else if (message instanceof Discord.Message)
return message.reply({
embeds: [embed],
allowedMentions: { repliedUser: false }
allowedMentions: { repliedUser: false, parse: ['users'] }
})
else if (message instanceof Discord.ModalSubmitInteraction)
return message.reply({ embeds: [embed], ephemeral: ephemeral })
return message.reply({
embeds: [embed],
ephemeral: ephemeral,
allowedMentions: { repliedUser: false, parse: ['users'] }
})
else if (message instanceof Discord.ButtonInteraction)
return message.reply({ embeds: [embed], ephemeral: ephemeral })
else return message.send({ embeds: [embed] })
Expand Down

0 comments on commit d01fdab

Please sign in to comment.