mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-06 14:20:51 +02:00
Cats
This commit is contained in:
+14
-11
@@ -56,7 +56,7 @@ client.on('message', (msg) => {
|
||||
if (!msg.guild) return;
|
||||
if (msg.author.bot || msg.member.hasPermission('ADMINISTRATOR')) return;
|
||||
const topic = msg.guild.defaultChannel.topic || '';
|
||||
if (!topic.includes('<inviteguard>')) return;
|
||||
if (!topic.toLowerCase().includes('<inviteguard>')) return;
|
||||
if (/(discord(\.gg\/|app\.com\/invite\/|\.me\/))/gi.test(msg.content)) {
|
||||
if (msg.channel.permissionsFor(client.user).has('MANAGE_MESSAGES')) msg.delete();
|
||||
msg.reply('Invites are prohibited from being posted here.');
|
||||
@@ -64,15 +64,16 @@ client.on('message', (msg) => {
|
||||
});
|
||||
|
||||
client.on('guildMemberAdd', (member) => {
|
||||
const channel = member.guild.channels.filter((channel) => {
|
||||
const topic = channel.topic || '';
|
||||
const channel = member.guild.channels.filter((c) => {
|
||||
const topic = c.topic || '';
|
||||
if (topic.includes('<memberlog>')) return true;
|
||||
else return false;
|
||||
}).first() || member.guild.channels.find('name', 'member-log');
|
||||
if (!channel || !channel.permissionsFor(client.user).has('SEND_MESSAGES')) return;
|
||||
const parseMsg = (topic) => {
|
||||
if (!topic || !/(<joinmessage:.+>)/gi.test(topic)) return '';
|
||||
const setting = topic.match(/(<joinmessage:.+>)/gi)[0];
|
||||
return setting.slice(13, setting.length - 1)
|
||||
if (!topic || !/(<joinmessage>.+<\/joinmessage>)/gi.test(topic)) return '';
|
||||
const setting = topic.match(/(<joinmessage>.+<\/joinmessage>)/gi)[0];
|
||||
return setting.slice(13, setting.length - 14)
|
||||
.replace(/(\(member\))/gi, member.user.username)
|
||||
.replace(/(\(server\))/gi, member.guild.name)
|
||||
.replace(/(\(mention\))/gi, member.toString());
|
||||
@@ -82,15 +83,16 @@ client.on('guildMemberAdd', (member) => {
|
||||
});
|
||||
|
||||
client.on('guildMemberRemove', (member) => {
|
||||
const channel = member.guild.channels.filter((channel) => {
|
||||
const topic = channel.topic || '';
|
||||
const channel = member.guild.channels.filter((c) => {
|
||||
const topic = c.topic || '';
|
||||
if (topic.includes('<memberlog>')) return true;
|
||||
else return false;
|
||||
}).first() || member.guild.channels.find('name', 'member-log');
|
||||
if (!channel || !channel.permissionsFor(client.user).has('SEND_MESSAGES')) return;
|
||||
const parseMsg = (topic) => {
|
||||
if (!topic || !/(<leavemessage:.+>)/gi.test(topic)) return '';
|
||||
const setting = topic.match(/(<leavemessage:.+>)/gi)[0];
|
||||
return setting.slice(14, setting.length - 1)
|
||||
if (!topic || !/(<leavemessage>.+<\/leavemessage>)/gi.test(topic)) return '';
|
||||
const setting = topic.match(/(<leavemessage>.+<\/leavemessage>)/gi)[0];
|
||||
return setting.slice(14, setting.length - 15)
|
||||
.replace(/(\(member\))/gi, member.user.username)
|
||||
.replace(/(\(server\))/gi, member.guild.name)
|
||||
.replace(/(\(mention\))/gi, member.toString());
|
||||
@@ -99,6 +101,7 @@ client.on('guildMemberRemove', (member) => {
|
||||
channel.send(msg || `Bye ${member.user.username}...`);
|
||||
});
|
||||
|
||||
|
||||
client.on('guildCreate', async (guild) => {
|
||||
console.log(`[GUILD] I have joined ${guild.name}! (${guild.id})`);
|
||||
const guilds = await client.shard.fetchClientValues('guilds.size');
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
<h2>Notes</h2>
|
||||
<ol>
|
||||
<li>Moderation commands require a channel named mod-log to send Ban/Kick/Softban/Unban/Warn logs.</li>
|
||||
<li>To use member join/leave logging, place <memberlog> in the channel topic. Custom messages can be set with <joinmessage:messagegoeshere> and <leavemessage:messagegoeshere></li>
|
||||
<li>To use member join/leave logging, place <memberlog> in the channel topic. Custom messages can be set with <joinmessage<messagegoeshere</joinmessage> and <leavemessage<messagegoeshere</leavemessage></li>
|
||||
<li>To use invite guard, place <inviteguard> in the default channel topic.</li>
|
||||
<li>Use x;help to view a command list</li>
|
||||
<li>Visit my <a href="https://discord.gg/fqQF8mc">home server</a> for more support, or for updates, or if you just want to hang out.</li>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<h2>Notes</h2>
|
||||
<ol>
|
||||
<li>Moderation commands require a channel named mod-log to send Ban/Kick/Softban/Unban/Warn logs.</li>
|
||||
<li>To use member join/leave logging, place <memberlog> in the channel topic. Custom messages can be set with <joinmessage:messagegoeshere> and <leavemessage:messagegoeshere></li>
|
||||
<li>To use member join/leave logging, place <memberlog> in the channel topic. Custom messages can be set with <joinmessage<messagegoeshere</joinmessage> and <leavemessage<messagegoeshere</leavemessage></li>
|
||||
<li>To use invite guard, place <inviteguard> in the default channel topic.</li>
|
||||
<li>Use x;help to view a command list</li>
|
||||
<li>Visit my <a href="https://discord.gg/fqQF8mc">home server</a> for more support, or for updates, or if you just want to hang out.</li>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "25.1.0",
|
||||
"version": "25.1.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Shard.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user