mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 22:32:50 +02:00
Send leave messages to system channel.
This commit is contained in:
@@ -47,6 +47,17 @@ client.on('ready', () => {
|
|||||||
}, 60000);
|
}, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
client.on('guildMemberRemove', async member => {
|
||||||
|
const channel = member.guild.systemChannel;
|
||||||
|
if (!channel || !channel.permissionsFor(client.user).has('SEND_MESSAGES')) return null;
|
||||||
|
try {
|
||||||
|
await channel.send(`**${member.user.tag}** bailed on us...`);
|
||||||
|
return null;
|
||||||
|
} catch (err) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
client.on('disconnect', event => {
|
client.on('disconnect', event => {
|
||||||
client.logger.error(`[DISCONNECT] Disconnected with code ${event.code}.`);
|
client.logger.error(`[DISCONNECT] Disconnected with code ${event.code}.`);
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "105.1.0",
|
"version": "105.2.0",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user