mirror of
https://gitlab.com/ceda_ei/Quadnite-Bot
synced 2026-05-06 05:40:04 +02:00
Disallow insult / kys on bot
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
module.exports = (random, kys, default_text) => (ctx) => {
|
||||
module.exports = (random, kys, default_text, bot_text, excluded_names) => (ctx) => {
|
||||
|
||||
if (ctx.message.reply_to_message) {
|
||||
|
||||
const { from } = ctx.message.reply_to_message;
|
||||
const name = from.username ? "@" + from.username : from.firstName;
|
||||
if (name == excluded_names[0])
|
||||
return bot_text;
|
||||
return random(kys)().replace(/##name##/g, name);
|
||||
|
||||
} else {
|
||||
@@ -12,6 +14,10 @@ module.exports = (random, kys, default_text) => (ctx) => {
|
||||
if (text_array.length > 1) {
|
||||
|
||||
const name = text_array[1];
|
||||
if (excluded_names.includes(name)
|
||||
|| excluded_names.includes("@" + name))
|
||||
return bot_text;
|
||||
|
||||
return random(kys)().replace(/##name##/g, name);
|
||||
|
||||
} else
|
||||
|
||||
Reference in New Issue
Block a user