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

Use ugoki server instead of hard coded gifs

This commit is contained in:
2021-09-27 22:10:34 +05:30
parent 159ca9e87d
commit 7527fb6a1a
3 changed files with 11 additions and 696 deletions

View File

@@ -8,9 +8,8 @@ function joinUsers(users) {
}
module.exports = (forms, gifs) => (ctx) => {
module.exports = (forms, getGif) => (ctx) => {
const gif = gifs[Math.floor(Math.random() * gifs.length)];
const message = ctx.message.text.replace(/^[^ ]+\s*/, "")
.match(/^((@\w+(\s+|$))*)(.*)/);
const users = message[1].trim().split(" ").filter(i => i.length);
@@ -39,6 +38,7 @@ module.exports = (forms, gifs) => (ctx) => {
reply = forms.none
.replace("{}", user);
ctx.replyWithAnimation(gif, {caption: reply});
getGif()
.then(gif => ctx.replyWithAnimation(gif.data.url, {caption: reply}));
};