mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 23:05:04 +02:00
String Changes, Don't register tons of defaults
This commit is contained in:
@@ -25,8 +25,8 @@ module.exports = class CowsayCommand extends commando.Command {
|
||||
const turnToCowsay = args.text;
|
||||
return message.code(null, cowsay.say({
|
||||
text: turnToCowsay,
|
||||
e: "oO",
|
||||
T: "U "
|
||||
e: 'oO',
|
||||
T: 'U '
|
||||
})).catch(error => message.say(':x: Error! Perhaps the content is too long?'));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ module.exports = class EmbedCommand extends commando.Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
const embedMessage = message.content.split(" ").slice(1).join(" ");
|
||||
const embedMessage = message.content.split(' ').slice(1).join(' ');
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setAuthor(message.author.username, message.author.avatarURL)
|
||||
.setColor(0x00AE86)
|
||||
|
||||
@@ -34,7 +34,7 @@ module.exports = class PirateCommand extends commando.Command {
|
||||
console.log(`[Command] ${message.content}`);
|
||||
const turnToPirate = args.text;
|
||||
const pirate = pirateSpeak.translate(turnToPirate);
|
||||
if (pirate.length > 1950) return message.say(":x: Error! Your message is too long!");
|
||||
if (pirate.length > 1950) return message.say(':x: Error! Your message is too long!');
|
||||
return message.say(pirate);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@ module.exports = class ReverseCommand extends commando.Command {
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
const stringToReverse = args.text;
|
||||
const reversed = stringToReverse.split("").reverse().join("");
|
||||
const reversed = stringToReverse.split('').reverse().join('');
|
||||
return message.say(reversed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const commando = require('discord.js-commando');
|
||||
|
||||
String.prototype.shuffle = function() {
|
||||
let a = this.split(""),
|
||||
let a = this.split(''),
|
||||
n = a.length;
|
||||
for (let i = n - 1; i > 0; i--) {
|
||||
let j = Math.floor(Math.random() * (i + 1));
|
||||
@@ -9,7 +9,7 @@ String.prototype.shuffle = function() {
|
||||
a[i] = a[j];
|
||||
a[j] = tmp;
|
||||
}
|
||||
return a.join("");
|
||||
return a.join('');
|
||||
};
|
||||
|
||||
module.exports = class ShuffleCommand extends commando.Command {
|
||||
|
||||
@@ -7,8 +7,8 @@ module.exports = class TemmieCommand extends commando.Command {
|
||||
name: 'temmie',
|
||||
group: 'textedit',
|
||||
memberName: 'temmie',
|
||||
description: "Translate text to Temmie speak. (;temmie I am Temmie)",
|
||||
examples: [";temmie I am Temmie."],
|
||||
description: 'Translate text to Temmie speak. (;temmie I am Temmie)',
|
||||
examples: [';temmie I am Temmie.'],
|
||||
args: [{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to Temmie speak?',
|
||||
|
||||
@@ -255,31 +255,31 @@ function isLetter(character) {
|
||||
}
|
||||
|
||||
function translator(text) {
|
||||
let translatedText = "";
|
||||
let word = "";
|
||||
let translatedText = '';
|
||||
let word = '';
|
||||
for (let i = 0; i < text.length; i += 1) {
|
||||
let character = text[i];
|
||||
if (isLetter(character)) {
|
||||
word += character;
|
||||
}
|
||||
else {
|
||||
if (word != "") {
|
||||
if (word != '') {
|
||||
let wordTranslate = translateWord(word);
|
||||
translatedText += wordTranslate;
|
||||
word = "";
|
||||
word = '';
|
||||
}
|
||||
translatedText += character;
|
||||
}
|
||||
}
|
||||
|
||||
if (word !== "") translatedText += translateWord(word);
|
||||
if (word !== '') translatedText += translateWord(word);
|
||||
|
||||
return translatedText;
|
||||
}
|
||||
|
||||
module.exports = function(text) {
|
||||
let currentTranslation = translator(text);
|
||||
let temmify = currentTranslation.split("ing").join("in").split("!").join("!!!!111!11!1!!!1!!!1111!").split("'").join("");
|
||||
let temmify = currentTranslation.split('ing').join('in').split('!').join('!!!!111!11!1!!!1!!!1111!').split("'").join('');
|
||||
|
||||
return temmify;
|
||||
};
|
||||
|
||||
@@ -115,7 +115,7 @@ module.exports = class TranslateCommand extends commando.Command {
|
||||
group: 'textedit',
|
||||
memberName: 'translate',
|
||||
description: 'Translates text to a given language. (;translate ja Give me the money!)',
|
||||
details: "**Codes:** af: Afrikaans, sq: Albanian, ar: Arabic, hy: Armenian, az: Azerbaijani, eu: Basque, be: Belarusian, bn: Bengali, bs: Bosnian, bg: Bulgarian, ca: Catalan, ceb: Cebuano, ny: Chichewa, zh-cn: Chinese Simplified, zh-tw: Chinese Traditional, co: Corsican, hr: Croatian, cs: Czech, da: Danish, nl: Dutch, en: English, eo: Esperanto, et: Estonian, tl: Filipino, fi: Finnish, fr: French, fy: Frisian, gl: Galician, ka: Georgian, de: German, el: Greek, gu: Gujarati, ht: Haitian Creole, ha: Hausa, haw: Hawaiian, iw: Hebrew, hi: Hindi, hmn: Hmong, hu: Hungarian, is: Icelandic, ig: Igbo, id: Indonesian, ga: Irish, it: Italian, ja: Japanese, jw: Javanese, kn: Kannada, kk: Kazakh, km: Khmer, ko: Korean, ku: Kurdish (Kurmanji), ky: Kyrgyz, lo: Lao, la: Latin, lv: Latvian, lt: Lithuanian, lb: Luxembourgish, mk: Macedonian, mg: Malagasy, ms: Malay, ml: Malayalam, mt: Maltese, mi: Maori, mr: Marathi, mn: Mongolian, my: Myanmar (Burmese), ne: Nepali, no: Norwegian, ps: Pashto, fa: Persian, pl: Polish, pt: Portuguese, ma: Punjabi, ro: Romanian, ru: Russian, sm: Samoan, gd: Scots Gaelic, sr: Serbian, st: Sesotho, sn: Shona, sd: Sindhi, si: Sinhala, sk: Slovak, sl: Slovenian, so: Somali, es: Spanish, su: Sudanese, sw: Swahili, sv: Swedish, tg: Tajik, ta: Tamil, te: Telugu, th: Thai, tr: Turkish, uk: Ukrainian, ur: Urdu, uz: Uzbek, vi: Vietnamese, cy: Welsh, xh: Xhosa, yi: Yiddish, yo: Yoruba, zu: Zulu",
|
||||
details: '**Codes:** af: Afrikaans, sq: Albanian, ar: Arabic, hy: Armenian, az: Azerbaijani, eu: Basque, be: Belarusian, bn: Bengali, bs: Bosnian, bg: Bulgarian, ca: Catalan, ceb: Cebuano, ny: Chichewa, zh-cn: Chinese Simplified, zh-tw: Chinese Traditional, co: Corsican, hr: Croatian, cs: Czech, da: Danish, nl: Dutch, en: English, eo: Esperanto, et: Estonian, tl: Filipino, fi: Finnish, fr: French, fy: Frisian, gl: Galician, ka: Georgian, de: German, el: Greek, gu: Gujarati, ht: Haitian Creole, ha: Hausa, haw: Hawaiian, iw: Hebrew, hi: Hindi, hmn: Hmong, hu: Hungarian, is: Icelandic, ig: Igbo, id: Indonesian, ga: Irish, it: Italian, ja: Japanese, jw: Javanese, kn: Kannada, kk: Kazakh, km: Khmer, ko: Korean, ku: Kurdish (Kurmanji), ky: Kyrgyz, lo: Lao, la: Latin, lv: Latvian, lt: Lithuanian, lb: Luxembourgish, mk: Macedonian, mg: Malagasy, ms: Malay, ml: Malayalam, mt: Maltese, mi: Maori, mr: Marathi, mn: Mongolian, my: Myanmar (Burmese), ne: Nepali, no: Norwegian, ps: Pashto, fa: Persian, pl: Polish, pt: Portuguese, ma: Punjabi, ro: Romanian, ru: Russian, sm: Samoan, gd: Scots Gaelic, sr: Serbian, st: Sesotho, sn: Shona, sd: Sindhi, si: Sinhala, sk: Slovak, sl: Slovenian, so: Somali, es: Spanish, su: Sudanese, sw: Swahili, sv: Swedish, tg: Tajik, ta: Tamil, te: Telugu, th: Thai, tr: Turkish, uk: Ukrainian, ur: Urdu, uz: Uzbek, vi: Vietnamese, cy: Welsh, xh: Xhosa, yi: Yiddish, yo: Yoruba, zu: Zulu',
|
||||
examples: [';translate ja Give me the the money!'],
|
||||
args: [{
|
||||
key: 'to',
|
||||
@@ -162,7 +162,7 @@ module.exports = class TranslateCommand extends commando.Command {
|
||||
return message.embed(embed);
|
||||
}
|
||||
catch (err) {
|
||||
return message.say(":x: Error! Something went wrong!");
|
||||
return message.say(':x: Error! Something went wrong!');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -12,8 +12,8 @@ module.exports = class WebhookCommand extends commando.Command {
|
||||
],
|
||||
group: 'textedit',
|
||||
memberName: 'webhook',
|
||||
description: "Posts a message to the webhook defined in config. (;webhook Hey guys!)",
|
||||
examples: [";webhook Hey guys!"],
|
||||
description: 'Posts a message to the webhook defined in config. (;webhook Hey guys!)',
|
||||
examples: [';webhook Hey guys!'],
|
||||
guildOnly: true,
|
||||
args: [{
|
||||
key: 'text',
|
||||
@@ -39,7 +39,7 @@ module.exports = class WebhookCommand extends commando.Command {
|
||||
.send({
|
||||
content: content
|
||||
});
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
catch (err) {
|
||||
return message.say(':x: Error! Message failed to send!');
|
||||
|
||||
@@ -37,7 +37,7 @@ module.exports = class YodaCommand extends commando.Command {
|
||||
return message.say(response.text);
|
||||
}
|
||||
catch (err) {
|
||||
return message.say(":x: Error! Something went wrong!");
|
||||
return message.say(':x: Error! Something went wrong!');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user