Add site breaker ping

This commit is contained in:
Tarrgon
2026-07-08 11:35:57 -04:00
parent 8643a99ab3
commit df785f1eac
4 changed files with 24 additions and 2 deletions
+12
View File
@@ -122,6 +122,12 @@ export default {
.setName('github-release-channel')
.setDescription('Set the github release channel.')
.setRequired(false)
)
.addRoleOption(option =>
option
.setName('site-breaker-role')
.setDescription('Set the site breaker role.')
.setRequired(false)
),
handler: async function (client: Client, interaction: ChatInputCommandInteraction) {
if (!interaction.guildId) return; // This shouldn't occur, but TypeScript doesn't know that.
@@ -262,6 +268,12 @@ export default {
response.push(`**github_release_channel** has been set to ${githubReleaseChannel}.`);
}
const siteBreakerRole = interaction.options.getRole('site-breaker-role');
if (siteBreakerRole) {
await Database.updateGuildSettings(interaction.guildId, 'site_breaker_role_id', siteBreakerRole.id);
response.push(`**site_breaker_role_id** has been set to ${siteBreakerRole}.`);
}
if (response.length == 0) return interaction.editReply({ content: 'No settings have been modified.' });
interaction.editReply({ content: response.join('\n') });
}
+2 -1
View File
@@ -28,8 +28,9 @@ export type GuildSettings = {
link_skip_channels?: string
github_release_channel?: string
moderator_channel_id?: string
private_help_channel_id?: string,
private_help_channel_id?: string
appeals_channel_id?: string
site_breaker_role_id?: string
}
type GuildSetting = Exclude<keyof GuildSettings, 'guild_id'>
+1 -1
View File
@@ -220,7 +220,7 @@ async function handleGithubRelease(client: Client, req: Request, res: Response):
const date = new Date();
let message = `## [${months[date.getUTCMonth()]} ${date.getUTCDate()}, ${date.getUTCFullYear()}](<${data.release.html_url}>)\n\n${await fixPings(removeIssueLinks(data.release.body))}`;
let message = `## [${months[date.getUTCMonth()]} ${date.getUTCDate()}, ${date.getUTCFullYear()}](<${data.release.html_url}>)\n\n${settings.site_breaker_role_id ? `<@&${settings.site_breaker_role_id}>\n` : ''}${await fixPings(removeIssueLinks(data.release.body))}`;
logDebug('Sending github release message');