mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-06 14:20:51 +02:00
v13
This commit is contained in:
@@ -2,15 +2,18 @@ require('dotenv').config();
|
||||
const { XIAO_TOKEN, OWNERS, XIAO_PREFIX, INVITE, APRIL_FOOLS } = process.env;
|
||||
const { mkdir } = require('fs/promises');
|
||||
const path = require('path');
|
||||
const { Intents, MessageEmbed } = require('discord.js');
|
||||
const { Intents, Permissions, SystemChannelFlags, MessageEmbed } = require('discord.js');
|
||||
const Client = require('./structures/Client');
|
||||
const client = new Client({
|
||||
commandPrefix: XIAO_PREFIX,
|
||||
owner: OWNERS.split(','),
|
||||
invite: INVITE,
|
||||
disableMentions: 'everyone',
|
||||
partials: ['GUILD_MEMBER'],
|
||||
ws: { intents: [Intents.NON_PRIVILEGED, 'GUILD_MEMBERS'] }
|
||||
allowedMentions: {
|
||||
parse: ['users'],
|
||||
repliedUser: true
|
||||
},
|
||||
partials: ['GUILD_MEMBER', 'CHANNEL'],
|
||||
intents: [Intents.NON_PRIVILEGED, Intents.FLAGS.GUILD_MEMBERS]
|
||||
});
|
||||
const { formatNumber, checkFileExists } = require('./util/Util');
|
||||
const aprilFoolsMsgs = require('./assets/json/april-fools');
|
||||
@@ -337,8 +340,8 @@ client.on('guildDelete', async guild => {
|
||||
client.on('guildMemberRemove', async member => {
|
||||
if (member.id === client.user.id) return null;
|
||||
const channel = member.guild.systemChannel;
|
||||
if (!channel || !channel.permissionsFor(client.user).has('SEND_MESSAGES')) return null;
|
||||
if (member.guild.systemChannelFlags.has('WELCOME_MESSAGE_DISABLED')) return null;
|
||||
if (!channel || !channel.permissionsFor(client.user).has(Permissions.FLAGS.SEND_MESSAGES)) return null;
|
||||
if (member.guild.systemChannelFlags.has(SystemChannelFlags.FLAGS.SUPPRESS_JOIN_NOTIFICATIONS)) return null;
|
||||
if (channel.topic && channel.topic.includes('<xiao:disable-leave>')) return null;
|
||||
try {
|
||||
const leaveMessage = client.leaveMessages[Math.floor(Math.random() * client.leaveMessages.length)];
|
||||
|
||||
@@ -29,14 +29,14 @@ module.exports = class ServerCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
if (!msg.guild.members.cache.has(msg.guild.ownerID)) await msg.guild.members.fetch(msg.guild.ownerID);
|
||||
const owner = await msg.guild.fetchOwner();
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x00AE86)
|
||||
.setThumbnail(msg.guild.iconURL({ format: 'png' }))
|
||||
.addField('❯ Name', msg.guild.name, true)
|
||||
.addField('❯ ID', msg.guild.id, true)
|
||||
.addField('❯ Creation Date', moment.utc(msg.guild.createdAt).format('MM/DD/YYYY h:mm A'), true)
|
||||
.addField('❯ Owner', msg.guild.owner.user.tag, true)
|
||||
.addField('❯ Owner', owner.user.tag, true)
|
||||
.addField('❯ Boost Count', formatNumber(msg.guild.premiumSubscriptionCount || 0), true)
|
||||
.addField('❯ Boost Tier', msg.guild.premiumTier ? `Tier ${msg.guild.premiumTier}` : 'None', true)
|
||||
.addField('❯ Region', msg.guild.region.toUpperCase(), true)
|
||||
|
||||
@@ -15,7 +15,7 @@ const flags = {
|
||||
TEAM_USER: 'Team User',
|
||||
SYSTEM: 'System',
|
||||
VERIFIED_BOT: 'Verified Bot',
|
||||
EARLY_VERIFIED_DEVELOPER: 'Early Verified Bot Developer'
|
||||
EARLY_VERIFIED_BOT_DEVELOPER: 'Early Verified Bot Developer'
|
||||
};
|
||||
const deprecated = ['DISCORD_PARTNER', 'VERIFIED_DEVELOPER'];
|
||||
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@
|
||||
"connect4-ai": "^0.1.3",
|
||||
"custom-translate": "^2.2.8",
|
||||
"didyoumean2": "^4.2.0",
|
||||
"discord.js": "^12.5.3",
|
||||
"discord.js": "github:discordjs/discord.js",
|
||||
"discord.js-commando": "github:discordjs/Commando",
|
||||
"discord.js-docs": "github:TeeSeal/discord.js-docs",
|
||||
"dotenv": "^9.0.2",
|
||||
|
||||
Reference in New Issue
Block a user