【问题标题】:TTS Discord BotTTS 不和谐机器人
【发布时间】:2021-08-05 06:47:50
【问题描述】:

我正在编写一个不和谐的机器人,但在 TTS 命令中我尝试运行它,但它不适用于此代码(我已经安装了 npm i discord-tts )所以我尝试了一切让它工作但它没有,我想知道我错过了什么吗?

const discordTTS = require("discord-tts");
const Command = require('../Command.js');


module.exports = class SpeakCommand extends Command {
    constructor(client) {
        super(client, {
            name: 'speak',
            usage: 'speak <message>',
            description: 'Speaks TTS message.',
            type: client.types.FUN
        });
    }

    async run(message, args) {

        function tts(voiceChannel, text) {
            const broadcast = bot.voice.createBroadcast();
            var channelId = message.member.voice.channelID;
            var channel = bot.channels.cache.get(channelId);
            channel.join().then(connection => {
            broadcast.play(discordTTS.getVoiceStream(args));
            const dispatcher = connection.play(broadcast);

            });

        };
    }
}

【问题讨论】:

  • 怎么了?

标签: discord.js


【解决方案1】:

你只写了函数。 调用函数并填写参数。

【讨论】:

    猜你喜欢
    • 2018-03-20
    • 2020-07-03
    • 2020-09-23
    • 2021-10-30
    • 2021-05-27
    • 2021-07-15
    • 2022-01-07
    • 2021-01-09
    • 2019-09-13
    相关资源
    最近更新 更多