mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 00:07:36 +02:00
Replace all sendMessage calls with send
This commit is contained in:
@@ -19,7 +19,7 @@ class BinaryCommand extends commando.Command {
|
||||
}
|
||||
console.log("[Command] " + message.content);
|
||||
let turnToBinary = message.content.split(" ").slice(1).join(" ");
|
||||
message.channel.sendMessage(stringToBinary(turnToBinary)).catch(error => message.channel.sendMessage(':x: Error! Translation is too long, or nothing was entered!'));
|
||||
message.channel.send(stringToBinary(turnToBinary)).catch(error => message.channel.send(':x: Error! Translation is too long, or nothing was entered!'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class CowsayCommand extends commando.Command {
|
||||
}
|
||||
console.log("[Command] " + message.content);
|
||||
if(message.content.split(" ").slice(1).join(" ") === "") {
|
||||
message.channel.sendMessage(":x: Error! You entered nothing!");
|
||||
message.channel.send(":x: Error! You entered nothing!");
|
||||
} else {
|
||||
let turnToCowsay = message.content.split(" ").slice(1).join(" ");
|
||||
message.channel.sendCode(null, cowsay.say({
|
||||
@@ -27,7 +27,7 @@ class CowsayCommand extends commando.Command {
|
||||
e : "oO",
|
||||
T : "U "
|
||||
})).catch(error => {
|
||||
message.channel.sendMessage(':x: Error! Perhaps the content is too long?');
|
||||
message.channel.send(':x: Error! Perhaps the content is too long?');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class EmbedCommand extends commando.Command {
|
||||
console.log("[Command] " + message.content);
|
||||
let embedmessage = message.content.split(" ").slice(1).join(" ");
|
||||
if(embedmessage === "") {
|
||||
message.channel.sendMessage(":x: Error! Nothing to embed!");
|
||||
message.channel.send(":x: Error! Nothing to embed!");
|
||||
} else {
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setAuthor(message.author.username, message.author.avatarURL)
|
||||
|
||||
@@ -21,12 +21,12 @@ class PirateCommand extends commando.Command {
|
||||
let messagecontent = message.content.split(" ").slice(1).join(" ");
|
||||
let pirate = pirateSpeak.translate(messagecontent);
|
||||
if(messagecontent === "") {
|
||||
message.channel.sendMessage(":x: Error! Nothing to translate!");
|
||||
message.channel.send(":x: Error! Nothing to translate!");
|
||||
} else {
|
||||
if(pirate.length > 1950) {
|
||||
message.channel.sendMessage(":x: Error! Your message is too long!");
|
||||
message.channel.send(":x: Error! Your message is too long!");
|
||||
} else {
|
||||
message.channel.sendMessage(pirate);
|
||||
message.channel.send(pirate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ class ReverseCommand extends commando.Command {
|
||||
}
|
||||
let messagecontent = message.content.split(" ").slice(1).join(" ");
|
||||
if(messagecontent === "") {
|
||||
message.channel.sendMessage(":x: Error! Nothing to reverse!");
|
||||
message.channel.send(":x: Error! Nothing to reverse!");
|
||||
} else {
|
||||
let reversed = reverseString(messagecontent);
|
||||
message.channel.sendMessage(reversed);
|
||||
message.channel.send(reversed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,12 +22,12 @@ class RomajiCommand extends commando.Command {
|
||||
if(hepburn.containsKana(romajify)) {
|
||||
let romajified = hepburn.fromKana(romajify);
|
||||
if(romajified.length > 1950) {
|
||||
message.channel.sendMessage(":x: Error! Your message is too long!");
|
||||
message.channel.send(":x: Error! Your message is too long!");
|
||||
} else {
|
||||
message.channel.sendMessage(romajified);
|
||||
message.channel.send(romajified);
|
||||
}
|
||||
} else {
|
||||
message.channel.sendMessage(":x: Error! Message contains no Kana!\n:notepad_spiral: Note: You cannot use this command on Kanji!");
|
||||
message.channel.send(":x: Error! Message contains no Kana!\n:notepad_spiral: Note: You cannot use this command on Kanji!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ class SayCommand extends commando.Command {
|
||||
console.log("[Command] " + message.content);
|
||||
let Copycat = message.content.split(" ").slice(1).join(" ");
|
||||
if(Copycat === "") {
|
||||
message.channel.sendMessage(":x: Error! Nothing to say!");
|
||||
message.channel.send(":x: Error! Nothing to say!");
|
||||
} else {
|
||||
message.channel.sendMessage(Copycat);
|
||||
message.channel.send(Copycat);
|
||||
if (message.channel.type === 'dm') return;
|
||||
message.delete();
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ class ShuffleCommand extends commando.Command {
|
||||
}
|
||||
let shuffled = message.content.split(" ").slice(1).join(" ");
|
||||
if(shuffled === '') {
|
||||
message.channel.sendMessage(":x: Error! Nothing to shuffle!");
|
||||
message.channel.send(":x: Error! Nothing to shuffle!");
|
||||
} else {
|
||||
message.channel.sendMessage(shuffled.shuffle());
|
||||
message.channel.send(shuffled.shuffle());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,12 +24,12 @@ class TranslateCommand extends commando.Command {
|
||||
let [languageto] = message.content.toLowerCase().split(" ").slice(1);
|
||||
let messagecontent = message.content.split(" ").slice(2).join(" ");
|
||||
if(languageto === "list") {
|
||||
message.channel.sendMessage("‘af': 'Afrikaans’\n’sq': 'Albanian'\n'ar': 'Arabic’\n’hy': 'Armenian’\n’az': 'Azerbaijani’\n’eu': 'Basque’\n’be': 'Belarusian’\n’bn': 'Bengali’\n’bs': 'Bosnian’\n’bg': 'Bulgarian’\n’ca': 'Catalan’\n’ceb': 'Cebuano’\n’ny': 'Chichewa’\n’zh-cn': 'Chinese Simplified’\n’zh-tw': 'Chinese Traditional’\n’co': 'Corsican’\n’hr': 'Croatian’\n’cs': 'Czech’\n’da': 'Danish’\n’nl': 'Dutch’\n’en': 'English’\n’eo': 'Esperanto’\n’et': 'Estonian’\n’tl': 'Filipino’\n’fi': 'Finnish’\n’fr': 'French’\n’fy': 'Frisian’\n’gl': 'Galician’\n’ka': 'Georgian’\n’de': 'German’\n’el': 'Greek’\n’gu': 'Gujarati’\n’ht': 'Haitian Creole’\n’ha': 'Hausa’\n’haw': 'Hawaiian’\n’iw': 'Hebrew’\n’hi': 'Hindi’\n’hmn': 'Hmong’\n’hu': 'Hungarian’\n’is': 'Icelandic’\n’ig': 'Igbo’\n’id': 'Indonesian’\n’ga': 'Irish’\n’it': 'Italian’\n’ja': 'Japanese’\n’jw': 'Javanese’\n’kn': 'Kannada’\n’kk': 'Kazakh’\n’km': 'Khmer’\n’ko': 'Korean’\n’ku': 'Kurdish (Kurmanji)’\n’ky': 'Kyrgyz’\n’lo': 'Lao’\n’la': 'Latin’\n’lv': 'Latvian’\n’lt': 'Lithuanian’\n’lb': 'Luxembourgish’\n’mk': 'Macedonian’\n’mg': 'Malagasy’\n’ms': 'Malay’\n’ml': 'Malayalam’\n’mt': 'Maltese’\n’mi': 'Maori’\n’mr': 'Marathi’\n’mn': 'Mongolian’\n’my': 'Myanmar (Burmese)’\n’ne': 'Nepali’\n’no': 'Norwegian’\n’ps': 'Pashto’\n’fa': 'Persian’\n’pl': 'Polish’\n’pt': 'Portuguese’\n’ma': 'Punjabi’\n’ro': 'Romanian’\n’ru': 'Russian’\nsm': 'Samoan’\n’gd': 'Scots Gaelic’\n’sr': 'Serbian’\n’st': 'Sesotho’\n’sn': 'Shona’\n’sd': 'Sindhi’\n’si': 'Sinhala’\n’sk': 'Slovak’\n’sl': 'Slovenian’\n’so': 'Somali’\n’es': 'Spanish’\n’su': 'Sudanese’\n’sw': 'Swahili’\n’sv': 'Swedish’\n’tg': 'Tajik’\n’ta': 'Tamil’\n’te': 'Telugu’\n’th': 'Thai’\n’tr': 'Turkish’\n’uk': 'Ukrainian’\n’ur': 'Urdu’\n’uz': 'Uzbek’\n’vi': 'Vietnamese’\n’cy': 'Welsh’\n’xh': 'Xhosa’\n’yi': 'Yiddish’\n’yo': 'Yoruba’\n’zu': 'Zulu'");
|
||||
message.channel.send("‘af': 'Afrikaans’\n’sq': 'Albanian'\n'ar': 'Arabic’\n’hy': 'Armenian’\n’az': 'Azerbaijani’\n’eu': 'Basque’\n’be': 'Belarusian’\n’bn': 'Bengali’\n’bs': 'Bosnian’\n’bg': 'Bulgarian’\n’ca': 'Catalan’\n’ceb': 'Cebuano’\n’ny': 'Chichewa’\n’zh-cn': 'Chinese Simplified’\n’zh-tw': 'Chinese Traditional’\n’co': 'Corsican’\n’hr': 'Croatian’\n’cs': 'Czech’\n’da': 'Danish’\n’nl': 'Dutch’\n’en': 'English’\n’eo': 'Esperanto’\n’et': 'Estonian’\n’tl': 'Filipino’\n’fi': 'Finnish’\n’fr': 'French’\n’fy': 'Frisian’\n’gl': 'Galician’\n’ka': 'Georgian’\n’de': 'German’\n’el': 'Greek’\n’gu': 'Gujarati’\n’ht': 'Haitian Creole’\n’ha': 'Hausa’\n’haw': 'Hawaiian’\n’iw': 'Hebrew’\n’hi': 'Hindi’\n’hmn': 'Hmong’\n’hu': 'Hungarian’\n’is': 'Icelandic’\n’ig': 'Igbo’\n’id': 'Indonesian’\n’ga': 'Irish’\n’it': 'Italian’\n’ja': 'Japanese’\n’jw': 'Javanese’\n’kn': 'Kannada’\n’kk': 'Kazakh’\n’km': 'Khmer’\n’ko': 'Korean’\n’ku': 'Kurdish (Kurmanji)’\n’ky': 'Kyrgyz’\n’lo': 'Lao’\n’la': 'Latin’\n’lv': 'Latvian’\n’lt': 'Lithuanian’\n’lb': 'Luxembourgish’\n’mk': 'Macedonian’\n’mg': 'Malagasy’\n’ms': 'Malay’\n’ml': 'Malayalam’\n’mt': 'Maltese’\n’mi': 'Maori’\n’mr': 'Marathi’\n’mn': 'Mongolian’\n’my': 'Myanmar (Burmese)’\n’ne': 'Nepali’\n’no': 'Norwegian’\n’ps': 'Pashto’\n’fa': 'Persian’\n’pl': 'Polish’\n’pt': 'Portuguese’\n’ma': 'Punjabi’\n’ro': 'Romanian’\n’ru': 'Russian’\nsm': 'Samoan’\n’gd': 'Scots Gaelic’\n’sr': 'Serbian’\n’st': 'Sesotho’\n’sn': 'Shona’\n’sd': 'Sindhi’\n’si': 'Sinhala’\n’sk': 'Slovak’\n’sl': 'Slovenian’\n’so': 'Somali’\n’es': 'Spanish’\n’su': 'Sudanese’\n’sw': 'Swahili’\n’sv': 'Swedish’\n’tg': 'Tajik’\n’ta': 'Tamil’\n’te': 'Telugu’\n’th': 'Thai’\n’tr': 'Turkish’\n’uk': 'Ukrainian’\n’ur': 'Urdu’\n’uz': 'Uzbek’\n’vi': 'Vietnamese’\n’cy': 'Welsh’\n’xh': 'Xhosa’\n’yi': 'Yiddish’\n’yo': 'Yoruba’\n’zu': 'Zulu'");
|
||||
} else if(languages.entries[languageto]) {
|
||||
if(messagecontent === "") {
|
||||
message.channel.sendMessage(":x: Error! Nothing to translate!");
|
||||
message.channel.send(":x: Error! Nothing to translate!");
|
||||
} else if(messagecontent.length > 200) {
|
||||
message.channel.sendMessage(":x: Error! Please keep translations below 200 characters!");
|
||||
message.channel.send(":x: Error! Please keep translations below 200 characters!");
|
||||
} else {
|
||||
translate(messagecontent, {to: languageto}).then(res => {
|
||||
let languagefrom = res.from.language.iso.toLowerCase();
|
||||
@@ -41,11 +41,11 @@ class TranslateCommand extends commando.Command {
|
||||
res.text);
|
||||
message.channel.sendEmbed(embed).catch(console.error);
|
||||
}).catch(err => {
|
||||
message.channel.sendMessage(":x: Error!");
|
||||
message.channel.send(":x: Error!");
|
||||
});
|
||||
}
|
||||
} else {
|
||||
message.channel.sendMessage(":x: Error! Language not found!");
|
||||
message.channel.send(":x: Error! Language not found!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class YodaCommand extends commando.Command {
|
||||
console.log("[Command] " + message.content);
|
||||
let yodaspeak = message.content.split(" ").slice(1).join(" ");
|
||||
if(yodaspeak === "") {
|
||||
message.channel.sendMessage(':x: Error! Nothing to translate!');
|
||||
message.channel.send(':x: Error! Nothing to translate!');
|
||||
} else {
|
||||
const options = {
|
||||
method: 'GET',
|
||||
@@ -37,12 +37,12 @@ class YodaCommand extends commando.Command {
|
||||
}
|
||||
request(options).then(function (response) {
|
||||
if(response === undefined) {
|
||||
message.channel.sendMessage(':x: Error! Something went wrong! Keep it simple to avoid this error.');
|
||||
message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.');
|
||||
} else {
|
||||
message.channel.sendMessage(response).catch(error => message.channel.sendMessage(':x: Error! Something went wrong! Keep it simple to avoid this error.'));
|
||||
message.channel.send(response).catch(error => message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.'));
|
||||
}
|
||||
}).catch(function (err) {
|
||||
message.channel.sendMessage(":x: Error! Unknown Error. Try again later!");
|
||||
message.channel.send(":x: Error! Unknown Error. Try again later!");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,11 +20,11 @@ class ZalgoCommand extends commando.Command {
|
||||
console.log("[Command] " + message.content);
|
||||
let zalgoified = zalgo(message.content.split(" ").slice(1).join(" "));
|
||||
if(zalgoified === '') {
|
||||
message.channel.sendMessage(":x: Error! Nothing to zalgoify!");
|
||||
message.channel.send(":x: Error! Nothing to zalgoify!");
|
||||
} else if(zalgoified.length > 1950) {
|
||||
message.channel.sendMessage(":x: Error! Your message is too long!");
|
||||
message.channel.send(":x: Error! Your message is too long!");
|
||||
} else {
|
||||
message.channel.sendMessage(zalgoified);
|
||||
message.channel.send(zalgoified);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user