Compare commits

..

No commits in common. "83f6f5c52957d96b09aed8996aedad7b58a32132" and "54c06ad7d4202b2f19f2df9a458834be2782ab58" have entirely different histories.

17 changed files with 1276 additions and 941 deletions

2
.gitignore vendored
View File

@ -1,3 +1 @@
node_modules
data/*
!data/.gitkeep

View File

@ -1,16 +1,2 @@
# Quadnite-Bot
Source code for [@quadnite\_bot](https://t.me/quadnite_bot)
## Running your own instance
Quadnite bot depends on [Ugoki](https://gitlab.com/ceda_ei/ugoki) for providing
roleplay gifs. Once you have an instance of Ugoki (and optionally
[Ugoki Frontend](https://gitlab.com/ceda_ei/ugoki-frontend)) running:
- Clone this repo
- `npm install`
- `export BOT_API_KEY="your-token-for-bot"`
- `export FEEDBACK_ID="chat-id-where-feedback-is-forwarded-to"`
- `export UGOKI_ROOT="https://root.of.ugoki.api/server/"`
- `npm start`
Source code for @quadnite_bot

8
bot.js
View File

@ -1,9 +1,9 @@
const Telegraf = require("telegraf");
const { BOT_API_KEY, FEEDBACK_ID, UGOKI_ROOT } = process.env;
const { BOT_API_KEY, FEEDBACK_ID } = process.env;
const fs = require("fs").promises;
const commands = require("./commands");
const axios = require("axios");
const roleplay = require("./static/roleplay.json");
const roleplay = require("./roleplay.json");
const bot = new Telegraf(BOT_API_KEY);
bot.catch((err) => console.log(err));
@ -15,12 +15,12 @@ const data = [
"commands_list",
"words"
].map(file =>
fs.readFile("static/" + file + ".txt", "utf-8")
fs.readFile(file + ".txt", "utf-8")
.then(list =>
list.split("\n")));
Promise.all(data)
.then(data =>
commands(bot, [...data, roleplay], FEEDBACK_ID, BOT_API_KEY, UGOKI_ROOT, axios));
commands(bot, [...data, roleplay], FEEDBACK_ID, axios));
bot.launch();

View File

@ -9,9 +9,8 @@ const media_wiki = require("./media_wiki");
const info = require("./info");
const expand = require("./expand");
const roleplay = require("./roleplay");
const suggest = require("./suggest");
module.exports = (bot, [ questions, kys, insults, commands_list, words, roleplay_data ], feedback_id, apiToken, ugokiRoot, axios) => {
module.exports = (bot, [ questions, kys, insults, commands_list, words, roleplay_data ], feedback_id, axios) => {
bot.command("question", (ctx) => ctx.reply(random(questions)()));
bot.command("word", (ctx) => ctx.reply(random(words)()));
@ -64,40 +63,9 @@ module.exports = (bot, [ questions, kys, insults, commands_list, words, roleplay
bot.command("info", (ctx) => ctx.reply(info()(ctx), {parse_mode: "Markdown"}));
bot.command("expand", (ctx) => ctx.reply(expand(words)(ctx)));
bot.command("start", (ctx) => ctx.reply("Hi! I'm Octanite. Sibling of @quadnite_bot. My creator @ceda_ei created me as 'another option' to users who want the bot in their groups to have privacy mode enabled. \n\nPrivacy mode? Wut is that?\n- Well basically disabling privacy mode enables a bot to read all the messages. @quadnite_bot has that disabled. Enabling privacy mode causes the bot to not recieve messages at some times. To circumvet that, you need to append @octanite_bot to your commands or simply use @quadnite_bot. \n\n[P.S. - My creator doesn't store any messages or personal data. It's safe to use any of the two bots.]\nTo give feedback, use /feedback"));
bot.command("donate", (ctx) => ctx.reply("Thanks for considering to donate."
+ " To support the development and hosting of Quadnite Bot, you can "
+ "donate here: https://liberapay.com/ceda_ei/"));
function getGetGif(command) {
const alias = roleplay_data[command].alias;
if (alias)
return getGetGif(alias);
return () => axios.get(
`category/${command}/gif`,
{
baseURL: ugokiRoot
}
);
}
function getForms(name) {
if (roleplay_data[name].forms)
return roleplay_data[name].forms;
return getForms(roleplay_data[name].alias);
}
// Add all roleplay commands
Object.keys(roleplay_data).map(command =>
bot.command(command,
(ctx) => roleplay(getForms(command), getGetGif(command))(ctx)
)
);
bot.command("suggest", (ctx) => suggest(axios, apiToken, ugokiRoot)(ctx));
bot.command(command, ctx => roleplay(roleplay_data[command].forms, roleplay_data[command].gifs)(ctx)));
};

View File

@ -8,8 +8,9 @@ function joinUsers(users) {
}
module.exports = (forms, getGif) => (ctx) => {
module.exports = (forms, gifs) => (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);
@ -38,7 +39,6 @@ module.exports = (forms, getGif) => (ctx) => {
reply = forms.none
.replace("{}", user);
getGif()
.then(gif => ctx.replyWithAnimation(gif.data.url, {caption: reply}));
ctx.replyWithAnimation(gif, {caption: reply});
};

View File

@ -1,84 +0,0 @@
const ffmpeg = require("fluent-ffmpeg");
const fs = require("fs");
const FormData = require("form-data");
function ugokiUpload(axios, ugokiRoot, ctx, category, path) {
const form = new FormData();
form.append("file", fs.createReadStream(path));
return axios.post(`new_suggestion/${category}`, form,
{ headers: form.getHeaders(), baseURL: ugokiRoot })
.then(() => {
ctx.reply("Suggestion added.");
fs.unlink(path, () => {});
})
.catch((err) => {
console.error(err);
if (err.response && err.response.status == 404)
ctx.reply("Category doesn't exist");
else if (err.response && err.response.status == 409)
ctx.reply("Already suggested / added.");
else
ctx.reply("No clue what the hell happened but adding suggestion failed.");
});
}
module.exports = (axios, apiToken, ugokiRoot) => (ctx) => {
const category = ctx.message.text.split(" ")[1];
const reply = ctx.message.reply_to_message;
if (category && reply && reply.animation) {
return ctx.telegram.getFile(reply.animation.file_id)
.then(resp => {
return axios({
method: "get",
url: `https://api.telegram.org/file/bot${apiToken}/${resp.file_path}`,
responseType: "stream"
})
.then(async (response) => {
let stream = response.data;
let path = `data/${resp.file_unique_id}`;
const writer = fs.createWriteStream(path);
if (!resp.file_path.match(/\.gif$/)) {
await stream.pipe(writer);
stream = ffmpeg(path)
.on("error", function () {
fs.unlink(path, () => {});
ctx.reply("Something went wrong processing the gif");
})
.on("end", function () {
fs.unlink(path, () => {});
ugokiUpload(axios, ugokiRoot, ctx, category, path + ".gif");
})
.output(path + ".gif")
.outputFormat("gif")
.run();
} else
ugokiUpload(axios, ugokiRoot, category, ctx, path);
}
);
});
} else
ctx.reply("Reply to a gif with /suggest [category] "
+ "to suggest it to be used for [category]");
};

View File

350
package-lock.json generated
View File

@ -1,319 +1,51 @@
{
"name": "quadnite-bot",
"version": "1.0.0",
"lockfileVersion": 2,
"lockfileVersion": 1,
"requires": true,
"packages": {
"": {
"name": "quadnite-bot",
"version": "1.0.0",
"license": "GPL-3.0",
"dependencies": {
"axios": "^0.21.0",
"fluent-ffmpeg": "^2.1.2",
"form-data": "^4.0.0",
"telegraf": "^3.27.1"
}
},
"node_modules/@types/node": {
"version": "10.12.26",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.26.tgz",
"integrity": "sha512-nMRqS+mL1TOnIJrL6LKJcNZPB8V3eTfRo9FQA2b5gDvrHurC8XbSA86KNe0dShlEL7ReWJv/OU9NL7Z0dnqWTg=="
},
"node_modules/async": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.1.tgz",
"integrity": "sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg=="
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"node_modules/axios": {
"version": "0.21.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"dependencies": {
"follow-redirects": "^1.14.0"
}
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/debug": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
"integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
"dependencies": {
"ms": "2.1.2"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/fluent-ffmpeg": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.2.tgz",
"integrity": "sha1-yVLeIkD4EuvaCqgAbXd27irPfXQ=",
"dependencies": {
"async": ">=0.2.9",
"which": "^1.1.1"
},
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/follow-redirects": {
"version": "1.14.4",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz",
"integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
},
"node_modules/mime-db": {
"version": "1.49.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz",
"integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.32",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz",
"integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==",
"dependencies": {
"mime-db": "1.49.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/node-fetch": {
"version": "2.6.5",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
}
},
"node_modules/sandwich-stream": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/sandwich-stream/-/sandwich-stream-2.0.2.tgz",
"integrity": "sha512-jLYV0DORrzY3xaz/S9ydJL6Iz7essZeAfnAavsJ+zsJGZ1MOnsS52yRjU3uF3pJa/lla7+wisp//fxOwOH8SKQ==",
"engines": {
"node": ">= 0.10"
}
},
"node_modules/telegraf": {
"version": "3.27.1",
"integrity": "sha512-RQUnuNAEEWcLhRap81qwGUUqAy1KcvqANnA0G3pzZqFkhMe6LrTk5lVi9tdOaF0Ud/yOx5fdx0rNPYfiB27Z+w==",
"dependencies": {
"@types/node": "^10.1.2",
"debug": "^4.0.1",
"node-fetch": "^2.2.0",
"sandwich-stream": "^2.0.1",
"telegram-typings": "^3.6.0"
},
"engines": {
"node": ">=6.2.0"
}
},
"node_modules/telegram-typings": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/telegram-typings/-/telegram-typings-3.6.1.tgz",
"integrity": "sha512-njVv1EAhIZnmQVLocZEADYUyqA1WIXuVcDYlsp+mXua/XB0pxx+PKtMSPeZ/EE4wPWTw9h/hA9ASTT6yQelkiw=="
},
"node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
},
"node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
},
"node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
"dependencies": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"node_modules/which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"dependencies": {
"isexe": "^2.0.0"
},
"bin": {
"which": "bin/which"
}
}
},
"dependencies": {
"@types/node": {
"version": "10.12.26",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.26.tgz",
"integrity": "sha512-nMRqS+mL1TOnIJrL6LKJcNZPB8V3eTfRo9FQA2b5gDvrHurC8XbSA86KNe0dShlEL7ReWJv/OU9NL7Z0dnqWTg=="
},
"async": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.1.tgz",
"integrity": "sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg=="
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"axios": {
"version": "0.21.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"version": "0.18.0",
"requires": {
"follow-redirects": "^1.14.0"
}
},
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"requires": {
"delayed-stream": "~1.0.0"
"follow-redirects": "^1.3.0",
"is-buffer": "^1.1.5"
}
},
"debug": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
"integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
"requires": {
"ms": "2.1.2"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
},
"fluent-ffmpeg": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.2.tgz",
"integrity": "sha1-yVLeIkD4EuvaCqgAbXd27irPfXQ=",
"requires": {
"async": ">=0.2.9",
"which": "^1.1.1"
"ms": "^2.1.1"
}
},
"follow-redirects": {
"version": "1.14.4",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz",
"integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g=="
},
"form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.7.0.tgz",
"integrity": "sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
"debug": "^3.2.6"
}
},
"isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
},
"mime-db": {
"version": "1.49.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz",
"integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA=="
},
"mime-types": {
"version": "2.1.32",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz",
"integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==",
"requires": {
"mime-db": "1.49.0"
}
"is-buffer": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
},
"node-fetch": {
"version": "2.6.5",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
"requires": {
"whatwg-url": "^5.0.0"
}
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz",
"integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA=="
},
"sandwich-stream": {
"version": "2.0.2",
@ -322,46 +54,28 @@
},
"telegraf": {
"version": "3.27.1",
"integrity": "sha512-RQUnuNAEEWcLhRap81qwGUUqAy1KcvqANnA0G3pzZqFkhMe6LrTk5lVi9tdOaF0Ud/yOx5fdx0rNPYfiB27Z+w==",
"requires": {
"@types/node": "^10.1.2",
"debug": "^4.0.1",
"node-fetch": "^2.2.0",
"sandwich-stream": "^2.0.1",
"telegram-typings": "^3.6.0"
},
"dependencies": {
"debug": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
"requires": {
"ms": "^2.1.1"
}
}
}
},
"telegram-typings": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/telegram-typings/-/telegram-typings-3.6.1.tgz",
"integrity": "sha512-njVv1EAhIZnmQVLocZEADYUyqA1WIXuVcDYlsp+mXua/XB0pxx+PKtMSPeZ/EE4wPWTw9h/hA9ASTT6yQelkiw=="
},
"tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
},
"webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
},
"whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
"requires": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"requires": {
"isexe": "^2.0.0"
}
}
}
}

View File

@ -1,10 +1,10 @@
{
"name": "quadnite-bot",
"version": "2.0.0",
"version": "1.0.0",
"description": "A Telegram bot that makes chats in group more fun.",
"main": "bot.js",
"scripts": {
"start": "node bot.js"
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
@ -22,9 +22,7 @@
},
"homepage": "https://gitlab.com/ceda_ei/Quadnite-Bot#readme",
"dependencies": {
"axios": "^0.21.0",
"fluent-ffmpeg": "^2.1.2",
"form-data": "^4.0.0",
"axios": "^0.18.0",
"telegraf": "^3.27.1"
}
}

1150
roleplay.json Normal file

File diff suppressed because it is too large Load Diff

81
shrinkwrap.yaml Normal file
View File

@ -0,0 +1,81 @@
dependencies:
axios: 0.18.0
telegraf: 3.27.1
packages:
/@types/node/10.12.24:
dev: false
resolution:
integrity: sha512-GWWbvt+z9G5otRBW8rssOFgRY87J9N/qbhqfjMZ+gUuL6zoL+Hm6gP/8qQBG4jjimqdaNLCehcVapZ/Fs2WjCQ==
/axios/0.18.0:
dependencies:
follow-redirects: 1.6.1
is-buffer: 1.1.6
dev: false
resolution:
integrity: sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=
/debug/3.1.0:
dependencies:
ms: 2.0.0
dev: false
resolution:
integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
/debug/4.1.1:
dependencies:
ms: 2.1.1
dev: false
resolution:
integrity: sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
/follow-redirects/1.6.1:
dependencies:
debug: 3.1.0
dev: false
engines:
node: '>=4.0'
resolution:
integrity: sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ==
/is-buffer/1.1.6:
dev: false
resolution:
integrity: sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
/ms/2.0.0:
dev: false
resolution:
integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
/ms/2.1.1:
dev: false
resolution:
integrity: sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
/node-fetch/2.3.0:
dev: false
engines:
node: 4.x || >=6.0.0
resolution:
integrity: sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA==
/sandwich-stream/2.0.2:
dev: false
engines:
node: '>= 0.10'
resolution:
integrity: sha512-jLYV0DORrzY3xaz/S9ydJL6Iz7essZeAfnAavsJ+zsJGZ1MOnsS52yRjU3uF3pJa/lla7+wisp//fxOwOH8SKQ==
/telegraf/3.27.1:
dependencies:
'@types/node': 10.12.24
debug: 4.1.1
node-fetch: 2.3.0
sandwich-stream: 2.0.2
telegram-typings: 3.6.1
dev: false
engines:
node: '>=6.2.0'
resolution:
integrity: sha512-RQUnuNAEEWcLhRap81qwGUUqAy1KcvqANnA0G3pzZqFkhMe6LrTk5lVi9tdOaF0Ud/yOx5fdx0rNPYfiB27Z+w==
/telegram-typings/3.6.1:
dev: false
resolution:
integrity: sha512-njVv1EAhIZnmQVLocZEADYUyqA1WIXuVcDYlsp+mXua/XB0pxx+PKtMSPeZ/EE4wPWTw9h/hA9ASTT6yQelkiw==
registry: 'https://registry.npmjs.org/'
shrinkwrapMinorVersion: 9
shrinkwrapVersion: 3
specifiers:
axios: ^0.18.0
telegraf: ^3.27.1

View File

@ -1,476 +0,0 @@
{
"angry": {
"forms": {
"none": "{} is angry",
"others": "{} is angry at {}",
"reason": "{} is angry because {}",
"both": "{} is angry at {} for {}"
}
},
"bite": {
"forms": {
"none": "{} is biting",
"others": "{} is biting {}",
"reason": "{} is biting because {}",
"both": "{} is biting {} for {}"
}
},
"blush": {
"forms": {
"none": "{} is blushing",
"others": "{} is blushing at {}",
"reason": "{} is blushing because {}",
"both": "{} is blushing at {} for {}"
}
},
"bored": {
"forms": {
"none": "{} is bored",
"others": "{}, {} are bored",
"reason": "{} is bored because {}",
"both": "{}, {} are bored because {}"
}
},
"bonk": {
"forms": {
"none": "{} is bonking",
"others": "{} is bonking {}",
"reason": "{} is bonking because {}",
"both": "{} is bonking {} for {}"
}
},
"boop": {
"forms": {
"none": "{} is booping",
"others": "{} is booping {}",
"reason": "{} is booping because {}",
"both": "{} is booping {} for {}"
}
},
"chase": {
"forms": {
"none": "{} is chasing",
"others": "{} is chasing {}",
"reason": "{} is chasing because {}",
"both": "{} is chasing {} for {}"
}
},
"cheer": {
"forms": {
"none": "{} is cheering",
"others": "{} is cheering for {}",
"reason": "{} is cheering because {}",
"both": "{} is cheering for {} because {}"
}
},
"cringe": {
"forms": {
"none": "{} is cringing",
"others": "{} is cringing at {}",
"reason": "{} is cringing because {}",
"both": "{} is cringing at {} for {}"
}
},
"cry": {
"forms": {
"none": "{} is crying",
"others": "{} is crying at {}",
"reason": "{} is crying because {}",
"both": "{} is crying at {} for {}"
}
},
"cuddle": {
"forms": {
"none": "{} is cuddling",
"others": "{} is cuddling with {}",
"reason": "{} is cuddling because {}",
"both": "{} is cuddling with {} for {}"
}
},
"dab": {
"forms": {
"none": "{} is dabing",
"others": "{} is dabing at {}",
"reason": "{} is dabing because {}",
"both": "{} is dabing at {} for {}"
}
},
"dance": {
"forms": {
"none": "{} is dancing",
"others": "{} is dancing with {}",
"reason": "{} is dancing because {}",
"both": "{} is dancing with {} for {}"
}
},
"die": {
"forms": {
"none": "{} is dying",
"others": "{} is dying with {}",
"reason": "{} is dying because {}",
"both": "{} is dying with {} because {}"
}
},
"eat": {
"forms": {
"none": "{} is eating",
"others": "{} is eating with {}",
"reason": "{} is eating because {}",
"both": "{} is eating with {} for {}"
}
},
"facepalm": {
"forms": {
"none": "{} is facepalming",
"others": "{} is facepalming at {}",
"reason": "{} is facepalming because {}",
"both": "{} is facepalming at {} for {}"
}
},
"feed": {
"forms": {
"none": "{} is eating",
"others": "{} is feeding {}",
"reason": "{} is eating because {}",
"both": "{} is feeding {} for {}"
}
},
"glomp": {
"forms": {
"none": "{} is glomping",
"others": "{} is glomping {}",
"reason": "{} is glomping because {}",
"both": "{} is glomping {} for {}"
}
},
"handhold": {
"alias": "holdhands"
},
"happy": {
"forms": {
"none": "{} is happy",
"others": "{} is happy with {}",
"reason": "{} is happy because {}",
"both": "{} is happy with {} for {}"
}
},
"hate": {
"forms": {
"none": "{} is hating",
"others": "{} is hating {}",
"reason": "{} is hating because {}",
"both": "{} is hating {} for {}"
}
},
"holdhands": {
"forms": {
"none": "{} is holding hands",
"others": "{} is holding hands with {}",
"reason": "{} is holding hands because {}",
"both": "{} is holding hands with {} for {}"
}
},
"hide": {
"forms": {
"none": "{} is hiding",
"others": "{} is hiding from {}",
"reason": "{} is hiding because {}",
"both": "{} is hiding from {} for {}"
}
},
"highfive": {
"forms": {
"none": "{} is high fiving",
"others": "{} is high fiving with {}",
"reason": "{} is high fiving because {}",
"both": "{} is high fiving with {} for {}"
}
},
"hug": {
"forms": {
"none": "{} is hugging",
"others": "{} is hugging {}",
"reason": "{} is hugging because {}",
"both": "{} is hugging at {} for {}"
}
},
"kill": {
"forms": {
"none": "{} is killing",
"others": "{} is killing {}",
"reason": "{} is killing because {}",
"both": "{} is killing {} for {}"
}
},
"kiss": {
"forms": {
"none": "{} is kissing",
"others": "{} is kissing {}",
"reason": "{} is kissing because {}",
"both": "{} is kissing {} for {}"
}
},
"laugh": {
"forms": {
"none": "{} is laughing",
"others": "{} is laughing with {}",
"reason": "{} is laughing because {}",
"both": "{} is laughing with {} for {}"
}
},
"lick": {
"forms": {
"none": "{} is licking",
"others": "{} is licking {}",
"reason": "{} is licking {}",
"both": "{} is licking {} for {}"
}
},
"love": {
"forms": {
"none": "{} is loving",
"others": "{} is loving {}",
"reason": "{} is loving because {}",
"both": "{} is loving {} for {}"
}
},
"lurk": {
"forms": {
"none": "{} is lurking",
"others": "{} is lurking from {}",
"reason": "{} is lurking because {}",
"both": "{} is lurking from {} for {}"
}
},
"nervous": {
"forms": {
"none": "{} is nervous",
"others": "{} is nervous with {}",
"reason": "{} is nervous because {}",
"both": "{} is nervous with {} for {}"
}
},
"no": {
"forms": {
"none": "{} is saying no",
"others": "{} is saying no to {}",
"reason": "{} is saying no because {}",
"both": "{} is saying no to {} for {}"
}
},
"nom": {
"forms": {
"none": "{} is noming",
"others": "{} is noming {}",
"reason": "{} is noming because {}",
"both": "{} is noming {} for {}"
}
},
"nuzzle": {
"forms": {
"none": "{} is nuzzling",
"others": "{} is nuzzling {}",
"reason": "{} is nuzzling because {}",
"both": "{} is nuzzling {} for {}"
}
},
"panic": {
"forms": {
"none": "{} is panicking",
"others": "{} is panicking at {}",
"reason": "{} is panicking because {}",
"both": "{} is panicking at {} for {}"
}
},
"pat": {
"forms": {
"none": "{} is patting",
"others": "{} is patting {}",
"reason": "{} is patting because {}",
"both": "{} is patting {} for {}"
}
},
"peck": {
"forms": {
"none": "{} is pecking",
"others": "{} is pecking {}",
"reason": "{} is pecking because {}",
"both": "{} is pecking {} for {}"
}
},
"poke": {
"forms": {
"none": "{} is poking",
"others": "{} is poking {}",
"reason": "{} is poking because {}",
"both": "{} is poking {} for {}"
}
},
"pout": {
"forms": {
"none": "{} is pouting",
"others": "{} is pouting at {}",
"reason": "{} is pouting because {}",
"both": "{} is pouting at {} for {}"
}
},
"run": {
"forms": {
"none": "{} is running",
"others": "{} is running from {}",
"reason": "{} is running because {}",
"both": "{} is running from {} for {}"
}
},
"runs": {
"alias": "run"
},
"shoot": {
"forms": {
"none": "{} is shooting",
"others": "{} is shooting {}",
"reason": "{} is shooting because {}",
"both": "{} is shooting {} for {}"
}
},
"shrug": {
"forms": {
"none": "{} is shrugging",
"others": "{} is shrugging at {}",
"reason": "{} is shrugging because {}",
"both": "{} is shrugging at {} for {}"
}
},
"sip": {
"forms": {
"none": "{} is sipping",
"others": "{} is sipping with {}",
"reason": "{} is sipping because {}",
"both": "{} is sipping with {} for {}"
}
},
"slap": {
"forms": {
"none": "{} is slapping",
"others": "{} is slapping {}",
"reason": "{} is slapping because {}",
"both": "{} is slapping {} for {}"
}
},
"sleep": {
"forms": {
"none": "{} is sleeping",
"others": "{} is sleeping with {}",
"reason": "{} is sleeping because {}",
"both": "{} is sleeping {} for {}"
}
},
"sob": {
"alias": "sobs"
},
"sobs": {
"alias": "cry",
"forms": {
"none": "{} is sobbing",
"others": "{} is sobbing due to {}",
"reason": "{} is sobbing because {}",
"both": "{} is sobbing due to {} because {}"
}
},
"snuggle": {
"forms": {
"none": "{} is snuggling",
"others": "{} is snuggling {}",
"reason": "{} is snuggling because {}",
"both": "{} is snuggling {} for {}"
}
},
"stab": {
"forms": {
"none": "{} is stabbing",
"others": "{} is stabbing {}",
"reason": "{} is stabbing because {}",
"both": "{} is stabbing {} for {}"
}
},
"tease": {
"forms": {
"none": "{} is teasing",
"others": "{} is teasing {}",
"reason": "{} is teasing because {}",
"both": "{} is teasing {} for {}"
}
},
"think": {
"forms": {
"none": "{} is thinking",
"others": "{} is thinking with {}",
"reason": "{} is thinking because {}",
"both": "{} is thinking with {} for {}"
}
},
"thumbsup": {
"forms": {
"none": "{} is giving a thumbs up",
"others": "{} is giving a thumbs up to {}",
"reason": "{} is giving a thumbs up because {}",
"both": "{} is giving a thumbs up to {} for {}"
}
},
"tickle": {
"forms": {
"none": "{} is tickling",
"others": "{} is tickling {}",
"reason": "{} is tickling because {}",
"both": "{} is tickling {} for {}"
}
},
"triggered": {
"forms": {
"none": "{} is triggered",
"others": "{} is triggered by {}",
"reason": "{} is triggered because {}",
"both": "{} is triggered by {} because {}"
}
},
"twerk": {
"forms": {
"none": "{} is twerking",
"others": "{} is twerking with {}",
"reason": "{} is twerking because {}",
"both": "{} is twerking with {} because {}"
}
},
"wag": {
"forms": {
"none": "{} is wagging",
"others": "{} is wagging at {}",
"reason": "{} is wagging because {}",
"both": "{} is wagging at {} for {}"
}
},
"wave": {
"forms": {
"none": "{} is waving",
"others": "{} is waving at {}",
"reason": "{} is waving because {}",
"both": "{} is waving at {} for {}"
}
},
"wink": {
"forms": {
"none": "{} is winking",
"others": "{} is winking at {}",
"reason": "{} is winking because {}",
"both": "{} is winking at {} for {}"
}
},
"yes": {
"forms": {
"none": "{} is saying yes",
"others": "{} is saying yes to {}",
"reason": "{} is saying yes because {}",
"both": "{} is saying yes to {} for {}"
}
}
}