-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace endgame score with charge station score on result embed
Co-authored-by: Weston Bosworth <[email protected]> Fixes #5
- Loading branch information
1 parent
aea85e7
commit 1e68ede
Showing
8 changed files
with
131 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { | ||
type ChatInputCommandInteraction, | ||
SlashCommandBuilder, | ||
PermissionFlagsBits, | ||
ChannelType, | ||
} from "discord.js"; | ||
import logger from "../config/logger"; | ||
|
||
export const data = new SlashCommandBuilder() | ||
.setName("make_playoff_channels") | ||
.setDescription("Creates voice channels for each alliance in the playoffs") | ||
.setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles) | ||
.addIntegerOption((option) => | ||
option | ||
.setName("num_alliances") | ||
.setDescription("Number of alliances in the playoffs") | ||
.setRequired(false) | ||
.setMinValue(1) | ||
.setMaxValue(8) | ||
) | ||
.setDMPermission(false); | ||
|
||
export const execute = async (interaction: ChatInputCommandInteraction) => { | ||
await interaction.deferReply(); | ||
|
||
const numAlliances = interaction.options.getInteger("num_alliances") ?? 8; | ||
|
||
for (let i = 1; i <= numAlliances; i++) { | ||
const channel = await interaction.guild?.channels.create({ | ||
name: `Alliance ${i}`, | ||
type: ChannelType.GuildVoice, | ||
parent: process.env.DISCORD_CATEGORY_ID, | ||
}); | ||
if (!channel) { | ||
logger.error(`Failed to create voice channel for alliance ${i}`); | ||
await interaction.followUp( | ||
`❌ Failed to create voice channel for alliance ${i}` | ||
); | ||
return; | ||
} | ||
} | ||
|
||
await interaction.followUp(`✅ Successfully created playoff voice channels!`); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters