mirror of
https://gitlab.com/ceda_ei/Quadnite-Bot
synced 2026-05-06 05:40:04 +02:00
Add commands/index.js. Add /insults, /kys, answer commands.
Add shrinkwrap.yaml.
This commit is contained in:
22
commands/insult.js
Normal file
22
commands/insult.js
Normal file
@@ -0,0 +1,22 @@
|
||||
module.exports = (random, kys, default_text) => (ctx) => {
|
||||
|
||||
if (ctx.message.reply_to_message) {
|
||||
|
||||
const { from } = ctx.message.reply_to_message;
|
||||
const name = from.username ? "@" + from.username : from.firstName;
|
||||
return random(kys)().replace(/##name##/g, name);
|
||||
|
||||
} else {
|
||||
|
||||
const text_array = ctx.message.text.split(" ");
|
||||
if (text_array.length > 1) {
|
||||
|
||||
const name = text_array[1];
|
||||
return random(kys)().replace(/##name##/g, name);
|
||||
|
||||
} else
|
||||
return default_text;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user