Add site breaker ping
This commit is contained in:
@@ -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') });
|
||||
}
|
||||
|
||||
Vendored
+2
-1
@@ -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'>
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user