Skip to content

Commit

Permalink
Soundboard command, TTS disabled for f1
Browse files Browse the repository at this point in the history
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
jasper-buijs committed Apr 29, 2023
1 parent 5988a7e commit cb079ca
Show file tree
Hide file tree
Showing 4 changed files with 217 additions and 169 deletions.
5 changes: 3 additions & 2 deletions commands/formula_one.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions commands/soundboard.js
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 });
}
}
}
Loading

0 comments on commit cb079ca

Please sign in to comment.