-
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.
Soundboard command, TTS disabled for f1
ADD command to control soundboard permissions CHANGE disabled text-to-speech for f1 live race control messages BUMP version is now 3.1.4
- Loading branch information
1 parent
5988a7e
commit cb079ca
Showing
4 changed files
with
217 additions
and
169 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,23 @@ | ||
const { clientId, guildId } = require("../config.json"); | ||
const { SlashCommandBuilder, PermissionFlagsBits, ChannelType } = require("discord.js"); | ||
module.exports = { | ||
data: new SlashCommandBuilder().setName("soundboard").setDescription("Toggle soundboard functionality.").setDefaultMemberPermissions(PermissionFlagsBits.Administrator).addSubcommand(command => | ||
command.setName("enable").setDescription("Enable soundboard.").addChannelOption(op => | ||
op.setName("channel").setDescription("The channel in which to enable soundboard.").setRequired(true).addChannelTypes(ChannelType.GuildVoice))).addSubcommand(command => | ||
command.setName("disable").setDescription("Disable soundboard.").addChannelOption(op => | ||
op.setName("channel").setDescription("The channel in which to disable soundboard.").setRequired(true).addChannelTypes(ChannelType.GuildVoice))), | ||
async execute(client, interaction) { | ||
await interaction.deferReply({ ephemeral: true }); | ||
if (interaction.options.getSubcommand() == "enable") { | ||
const channel = interaction.options.getChannel("channel"); | ||
await channel.fetch(); | ||
await channel.permissionOverwrites.edit(client.guilds.cache.get(guildId).roles.everyone, {UseSoundboard: true}); | ||
await interaction.editReply({ content: "Soudnboard enabled.", ephemeral: true }); | ||
} else { | ||
const channel = interaction.options.getChannel("channel"); | ||
await channel.fetch(); | ||
await channel.permissionOverwrites.edit(client.guilds.cache.get(guildId).roles.everyone, {UseSoundboard: false}); | ||
await interaction.editReply({ content: "Soudnboard disabled.", ephemeral: true }); | ||
} | ||
} | ||
} |
Oops, something went wrong.