Fix formatting
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
module.exports = function(bot, api) {
|
||||
module.exports = function (bot, api) {
|
||||
bot.on('voiceStateUpdate', async (oldState, newState) => {
|
||||
if (newState.member.user.bot) return;
|
||||
if (oldState.channel && newState.channel) return;
|
||||
@@ -12,7 +12,7 @@ module.exports = function(bot, api) {
|
||||
if (!oldState.channel) {
|
||||
joined = true;
|
||||
}
|
||||
|
||||
|
||||
let username = newState.member.displayName;
|
||||
let str = "";
|
||||
if (!joined) {
|
||||
|
@@ -1,18 +1,18 @@
|
||||
module.exports = function(bot, api) {
|
||||
module.exports = function (bot, api) {
|
||||
api.registerCommand('announcevoice', (args, message) => {
|
||||
let channel = bot.voice.connections.first().channel;
|
||||
if(args.length>3) {
|
||||
if (args.length > 3) {
|
||||
return api.respond(message, "You tried to change my voice with too many arguments.");
|
||||
}
|
||||
if(api.ttsEngines[args[1]]) {
|
||||
api.announcementEngine=api.ttsEngines[args[1]];
|
||||
if(api.announcementEngine.validateVoice(args[2])) {
|
||||
api.announcementVoice=args[2];
|
||||
api.respond(message, "My new voice is "+api.announcementVoice+" from "+api.announcementEngine.longName);
|
||||
} else {
|
||||
api.announcementVoice=api.announcementEngine.getDefaultVoice();
|
||||
api.respond(message, "Your voice name was invalid, so I switched to the default voice ("+api.announcementVoice+") for "+api.announcementEngine.longName+" instead.");
|
||||
}
|
||||
if (api.ttsEngines[args[1]]) {
|
||||
api.announcementEngine = api.ttsEngines[args[1]];
|
||||
if (api.announcementEngine.validateVoice(args[2])) {
|
||||
api.announcementVoice = args[2];
|
||||
api.respond(message, "My new voice is " + api.announcementVoice + " from " + api.announcementEngine.longName);
|
||||
} else {
|
||||
api.announcementVoice = api.announcementEngine.getDefaultVoice();
|
||||
api.respond(message, "Your voice name was invalid, so I switched to the default voice (" + api.announcementVoice + ") for " + api.announcementEngine.longName + " instead.");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
@@ -1,10 +1,10 @@
|
||||
module.exports = function(bot, api) {
|
||||
module.exports = function (bot, api) {
|
||||
bot.on('ready', async () => {
|
||||
console.log("Bot initialized and listening");
|
||||
const guild = await bot.guilds.fetch(process.env.GUILD);
|
||||
const guild = await bot.guilds.fetch(process.env.GUILD);
|
||||
const channel = await bot.channels.fetch(process.env.CHANNEL);
|
||||
await api.joinChannel(channel);
|
||||
|
||||
|
||||
api.speak(channel, `Hey buddies! How does it feel like to be a buddy? Are you proud of being a buddy? Well that's great!'`);
|
||||
})
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user