mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Randomized leave messages
This commit is contained in:
@@ -10,6 +10,7 @@ const client = new Client({
|
||||
disabledEvents: ['TYPING_START']
|
||||
});
|
||||
const activities = require('./assets/json/activity');
|
||||
const leaveMsgs = require('./assets/json/leave-messages');
|
||||
|
||||
client.registry
|
||||
.registerDefaultTypes()
|
||||
@@ -52,7 +53,8 @@ client.on('guildMemberRemove', async member => {
|
||||
if (!channel || !channel.permissionsFor(client.user).has('SEND_MESSAGES')) return null;
|
||||
if (channel.topic && channel.topic.includes('<xiao:disable-leave>')) return null;
|
||||
try {
|
||||
await channel.send(`**${member.user.tag}** bailed on us...`);
|
||||
const leaveMsg = leaveMsgs[Math.floor(Math.random() * leaveMsgs.length)];
|
||||
await channel.send(leaveMsg.replace(/{{user}}/gi, `**${member.user.tag}**`));
|
||||
return null;
|
||||
} catch (err) {
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
[
|
||||
"{{user}} bailed on us...",
|
||||
"\"Look, what's that!\" said {{user}}, before dashing away.",
|
||||
"{{user}} ran away.",
|
||||
"{{user}} decided they didn't want to deal with you anymore and ran off.",
|
||||
"{{user}} jumped ship.",
|
||||
"{{user}} ate too much candy and was taken to a hospital in another server.",
|
||||
"{{user}} left to join a rival gang.",
|
||||
"{{user}} decided to take a break from your server. Possibly forever.",
|
||||
"{{user}} said \"See ya, suckers!\"",
|
||||
"According to all known laws of aviation, there is no way {{user}} should be able to fly. But they did, right out of your server.",
|
||||
"Goodbye, {{user}}!",
|
||||
"You forgot to feed {{user}}, so they ran away.",
|
||||
"{{user}} left to become a hermit in the mountains. I hear he has a goat now.",
|
||||
"{{user}} flew away. Wait, they have wings?!",
|
||||
"We'll miss you, {{user}}! I think.",
|
||||
"{{user}} left the nest. They grow up so fast...",
|
||||
"{{user}} is no longer a part of your family.",
|
||||
"And just like that, {{user}} said goodbye to your server and started a new adventure.",
|
||||
"In other news, local resident {{user}} leaves the server. Cites stupid bot \"Xiao\" as the reason. Wait, stupid?",
|
||||
"{{user}} left. How unfortunate."
|
||||
]
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "105.3.1",
|
||||
"version": "105.3.2",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user