mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Ignore Leave Message if the bot is the one leaving
This commit is contained in:
@@ -73,6 +73,7 @@ client.on('message', async msg => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
client.on('guildMemberRemove', async member => {
|
client.on('guildMemberRemove', async member => {
|
||||||
|
if (member.id === client.user.id) return null;
|
||||||
const channel = member.guild.systemChannel;
|
const channel = member.guild.systemChannel;
|
||||||
if (!channel || !channel.permissionsFor(client.user).has('SEND_MESSAGES')) return null;
|
if (!channel || !channel.permissionsFor(client.user).has('SEND_MESSAGES')) return null;
|
||||||
if (channel.topic && channel.topic.includes('<xiao:disable-leave>')) return null;
|
if (channel.topic && channel.topic.includes('<xiao:disable-leave>')) return null;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "112.19.14",
|
"version": "112.19.15",
|
||||||
"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