mirror of
https://github.com/gizmo4487/O-Bot.git
synced 2026-07-14 08:35:55 -05:00
Complete rewrite - Added slash commands
This commit is contained in:
25
cmd/voice/voice.js
Normal file
25
cmd/voice/voice.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const vcutil = require('../util/vc.js');
|
||||
const util = require('../util/util.js');
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('voice')
|
||||
.setDescription('Make O-Bot join a voice channel and speak')
|
||||
.addStringOption(option =>
|
||||
option.setName('type')
|
||||
.setDescription('Type of voice clip to play')
|
||||
.setMaxLength(6)
|
||||
.setRequired(false)
|
||||
.addChoices(
|
||||
{ name: 'Normal', value: 'normal' },
|
||||
{ name: 'Alt', value: 'alt' },
|
||||
{ name: 'JP', value: 'jp' },
|
||||
{ name: 'JP Alt', value: 'jp_alt' },
|
||||
)),
|
||||
async execute(interaction) {
|
||||
const voiceOption = interaction.options.getString('type') ?? 'normal';
|
||||
const prefix = 'o_sound' + (voiceOption!='normal'?'/' + voiceOption:'');
|
||||
const response = await vcutil.play(interaction, prefix + "/000000" + util.randomHex() + ".wav");
|
||||
await interaction.reply(response);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user