mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-16 15:57:54 +02:00
Bug Fixes and Minor Modifications
This commit is contained in:
@@ -2,21 +2,22 @@ const commando = require('discord.js-commando');
|
||||
const request = require('superagent');
|
||||
const config = require('../../config.json');
|
||||
|
||||
module.exports = class RinSayCommand extends commando.Command {
|
||||
module.exports = class WebhookCommand extends commando.Command {
|
||||
constructor(Client) {
|
||||
super(Client, {
|
||||
name: 'rin',
|
||||
name: 'webhook',
|
||||
aliases: [
|
||||
'rin',
|
||||
'rinsay'
|
||||
],
|
||||
group: 'textedit',
|
||||
memberName: 'rin',
|
||||
description: "Posts a message to the Rin webhook in Heroes of Dreamland. (;rin Hey guys!)",
|
||||
examples: [";rin Hey guys!"],
|
||||
memberName: 'webhook',
|
||||
description: "Posts a message to the webhook defined in config. (;webhook Hey guys!)",
|
||||
examples: [";webhook Hey guys!"],
|
||||
guildOnly: true,
|
||||
args: [{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like Rin to say?',
|
||||
prompt: 'What text would you like the webhook to say?',
|
||||
type: 'string'
|
||||
}]
|
||||
});
|
||||
@@ -30,12 +31,12 @@ module.exports = class RinSayCommand extends commando.Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'MANAGE_MESSAGES'])) return;
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let rinContent = args.text;
|
||||
let content = args.text;
|
||||
try {
|
||||
let post = await request
|
||||
.post(config.webhook)
|
||||
.send({
|
||||
content: rinContent
|
||||
content: content
|
||||
});
|
||||
let deleteMsg = await message.delete();
|
||||
return [post, deleteMsg];
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const commando = require('discord.js-commando');
|
||||
const Discord = require('discord.js');
|
||||
const translate = require('google-translate-api');
|
||||
|
||||
const languages = {
|
||||
"auto": "Automatic",
|
||||
"af": "Afrikaans",
|
||||
|
||||
@@ -32,7 +32,7 @@ module.exports = class YodaCommand extends commando.Command {
|
||||
'Accept': 'text/plain'
|
||||
})
|
||||
.query({
|
||||
sentence: turnToYoda
|
||||
sentence: encodeURI(turnToYoda)
|
||||
});
|
||||
if (!response.text) return message.say(':x: Error! Something went wrong! Keep it simple to avoid this error.');
|
||||
return message.say(response.text);
|
||||
|
||||
Reference in New Issue
Block a user