1
1
mirror of https://gitlab.com/ceda_ei/Quadnite-Bot synced 2026-05-06 05:40:04 +02:00

Add /weebify

This commit is contained in:
2019-02-12 04:37:50 +05:30
parent 56999fd89d
commit 3b945e17f3
2 changed files with 56 additions and 0 deletions

54
commands/weebify.js Normal file
View File

@@ -0,0 +1,54 @@
function weebify(text) {
const dict = {
a : "卂",
b : "乃",
c : "匚",
d : "刀",
e : "乇",
f : "下",
g : "厶",
h : "卄",
i : "工",
j : "丁",
k : "长",
l : "乚",
m : "从",
n : "𠘨",
o : "口",
p : "尸",
q : "㔿",
r : "尺",
s : "丂",
t : "丅",
u : "凵",
v : "リ",
w : "山",
x : "乂",
y : "丫",
z : "乙"
};
const text_array = text.toLowerCase().split("");
return text_array.map((character) =>
dict[character] ? dict[character] : character)
.join("");
}
module.exports = () => (ctx) => {
const message = ctx.message.text.replace(/^[^ ]+/, "");
if (message) {
return weebify(message);
} else {
if (ctx.message.reply_to_message)
return weebify(ctx.message.reply_to_message.text);
else
return "Need text to weebify. Send /weebify text or reply to a message with /weebify";
}
};