forked from Supositware/Haha-Yes
V14 update
This commit is contained in:
parent
6272cde878
commit
7e186a07a9
5 changed files with 4861 additions and 467 deletions
|
@ -1,6 +1,6 @@
|
||||||
import db from '../../models/index.js';
|
import db from '../../models/index.js';
|
||||||
const guildBlacklist = db.guildBlacklist;
|
const guildBlacklist = db.guildBlacklist;
|
||||||
import { MessageEmbed } from 'discord.js';
|
import { EmbedBuilder } from 'discord.js';
|
||||||
|
|
||||||
import dotenv from 'dotenv';
|
import dotenv from 'dotenv';
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
@ -25,16 +25,18 @@ export default {
|
||||||
const channel = client.channels.resolve(statusChannel);
|
const channel = client.channels.resolve(statusChannel);
|
||||||
const botCount = guild.members.cache.filter(member => member.user.bot).size;
|
const botCount = guild.members.cache.filter(member => member.user.bot).size;
|
||||||
console.log(guild.memberCount);
|
console.log(guild.memberCount);
|
||||||
const addEmbed = new MessageEmbed()
|
const addEmbed = new EmbedBuilder()
|
||||||
.setColor('#52e80d')
|
.setColor('#52e80d')
|
||||||
.setTitle('New boiz in town')
|
.setTitle('New boiz in town')
|
||||||
.setURL('https://www.youtube.com/watch?v=6n3pFFPSlW4')
|
.setURL('https://www.youtube.com/watch?v=6n3pFFPSlW4')
|
||||||
.setThumbnail(guild.iconURL())
|
.setThumbnail(guild.iconURL())
|
||||||
.addField('Guild', `${guild.name} (${guild.id})`)
|
.addFields(
|
||||||
.addField('Total number of members', guild.memberCount.toString(), true)
|
{ name: 'Guild', value: `${guild.name} (${guild.id})` },
|
||||||
.addField('Number of users', (guild.memberCount - botCount).toString(), true)
|
{ name: 'Total number of members', value: guild.memberCount.toString(), inline: true },
|
||||||
.addField('Number of bots', botCount.toString(), true)
|
{ name: 'Number of users', value: (guild.memberCount - botCount).toString(), inline: true },
|
||||||
.addField('Owner', `${guildOwner.username} (${guild.ownerId})`, true)
|
{ name: 'Number of bots', value: botCount.toString(), inline: true },
|
||||||
|
{ name: 'Owner', value: `${guildOwner.username} (${guild.ownerId})`, inline: true },
|
||||||
|
)
|
||||||
.setFooter({ text: `I'm now in ${client.guilds.cache.size} servers!` })
|
.setFooter({ text: `I'm now in ${client.guilds.cache.size} servers!` })
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import db from '../../models/index.js';
|
import db from '../../models/index.js';
|
||||||
const guildBlacklist = db.guildBlacklist;
|
const guildBlacklist = db.guildBlacklist;
|
||||||
import { MessageEmbed } from 'discord.js';
|
import { EmbedBuilder } from 'discord.js';
|
||||||
|
|
||||||
import dotenv from 'dotenv';
|
import dotenv from 'dotenv';
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
@ -21,16 +21,18 @@ export default {
|
||||||
const channel = client.channels.resolve(statusChannel);
|
const channel = client.channels.resolve(statusChannel);
|
||||||
const botCount = guild.members.cache.filter(member => member.user.bot).size;
|
const botCount = guild.members.cache.filter(member => member.user.bot).size;
|
||||||
console.log(guild.memberCount);
|
console.log(guild.memberCount);
|
||||||
const kickEmbed = new MessageEmbed()
|
const kickEmbed = new EmbedBuilder()
|
||||||
.setColor('#FF0000')
|
.setColor('#FF0000')
|
||||||
.setTitle('Some mofo just removed me from there guild :(')
|
.setTitle('Some mofo just removed me from there guild :(')
|
||||||
.setURL('https://www.youtube.com/watch?v=6n3pFFPSlW4')
|
.setURL('https://www.youtube.com/watch?v=6n3pFFPSlW4')
|
||||||
.setThumbnail(guild.iconURL())
|
.setThumbnail(guild.iconURL())
|
||||||
.addField('Guild', `${guild.name} (${guild.id})`)
|
.addFields(
|
||||||
.addField('Total number of members', guild.memberCount.toString(), true)
|
{ name: 'Guild', value: `${guild.name} (${guild.id})` },
|
||||||
.addField('Number of users', (guild.memberCount - botCount).toString(), true)
|
{ name: 'Total number of members', value: guild.memberCount.toString(), inline: true },
|
||||||
.addField('Number of bots', botCount.toString(), true)
|
{ name: 'Number of users', value: (guild.memberCount - botCount).toString(), inline: true },
|
||||||
.addField('Owner', `${guildOwner.username} (${guild.ownerId})`, true)
|
{ name: 'Number of bots', value: botCount.toString(), inline: true },
|
||||||
|
{ name: 'Owner', value: `${guildOwner.username} (${guild.ownerId})`, inline: true },
|
||||||
|
)
|
||||||
.setFooter({ text: `I'm now in ${client.guilds.cache.size} servers!` })
|
.setFooter({ text: `I'm now in ${client.guilds.cache.size} servers!` })
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Permissions } from 'discord.js';
|
import { PermissionFlagsBits, InteractionType } from 'discord.js';
|
||||||
import db from '../../models/index.js';
|
import db from '../../models/index.js';
|
||||||
const ratelimit = {};
|
const ratelimit = {};
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ export default {
|
||||||
name: 'interactionCreate',
|
name: 'interactionCreate',
|
||||||
async execute(interaction) {
|
async execute(interaction) {
|
||||||
const client = interaction.client;
|
const client = interaction.client;
|
||||||
if (!interaction.isCommand()) return;
|
if (interaction.type !== InteractionType.ApplicationCommand) return;
|
||||||
|
|
||||||
const globalBlacklist = await db.Blacklists.findOne({ where: { type:'global', uid:interaction.user.id } });
|
const globalBlacklist = await db.Blacklists.findOne({ where: { type:'global', uid:interaction.user.id } });
|
||||||
const commandBlacklist = await db.Blacklists.findOne({ where: { type:interaction.commandName, uid:interaction.user.id } });
|
const commandBlacklist = await db.Blacklists.findOne({ where: { type:interaction.commandName, uid:interaction.user.id } });
|
||||||
|
@ -40,14 +40,14 @@ export default {
|
||||||
if (command.clientPermissions) {
|
if (command.clientPermissions) {
|
||||||
const clientMember = await interaction.guild.members.fetch(client.user.id);
|
const clientMember = await interaction.guild.members.fetch(client.user.id);
|
||||||
if (!clientMember.permissions.has(command.clientPermissions)) {
|
if (!clientMember.permissions.has(command.clientPermissions)) {
|
||||||
return interaction.reply({ content: `❌ I am missing one of the following permission(s): \`${new Permissions(command.clientPermissions).toArray()}\``, ephemeral: true });
|
return interaction.reply({ content: `❌ I am missing one of the following permission(s): \`${new PermissionFlagsBits(command.clientPermissions).toArray()}\``, ephemeral: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the user has the needed permissions
|
// Check if the user has the needed permissions
|
||||||
if (command.userPermissions) {
|
if (command.userPermissions) {
|
||||||
if (!interaction.member.permissions.has(command.userPermissions)) {
|
if (!interaction.member.permissions.has(command.userPermissions)) {
|
||||||
return interaction.reply({ content: `❌ You are missing one of the following permission(s): \`${new Permissions(command.userPermissions).toArray()}\``, ephemeral: true });
|
return interaction.reply({ content: `❌ You are missing one of the following permission(s): \`${new PermissionFlagsBits(command.userPermissions).toArray()}\``, ephemeral: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,20 @@ export default {
|
||||||
ratelimit[userID] = { command: commandName, limit: ratelimit[userID].limit, cooldown: date };
|
ratelimit[userID] = { command: commandName, limit: ratelimit[userID].limit, cooldown: date };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await command.execute(interaction);
|
|
||||||
|
const args = [];
|
||||||
|
interaction.options.data.forEach(arg => {
|
||||||
|
console.log(arg);
|
||||||
|
if (arg.type === 'MENTIONABLE') {
|
||||||
|
return args.push(arg.member);
|
||||||
|
}
|
||||||
|
else if (arg.type === 'ATTACHMENT') {
|
||||||
|
return args.push(arg.attachment);
|
||||||
|
}
|
||||||
|
args.push(arg.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
await command.execute(interaction, args, client);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
5265
package-lock.json
generated
5265
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -17,14 +17,14 @@
|
||||||
"homepage": "https://libtar.de",
|
"homepage": "https://libtar.de",
|
||||||
"license": "AGPL",
|
"license": "AGPL",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordjs/builders": "^0.13.0",
|
|
||||||
"@discordjs/rest": "^0.4.1",
|
"@discordjs/rest": "^0.4.1",
|
||||||
"discord-api-types": "^0.33.1",
|
"discord-api-types": "^0.33.5",
|
||||||
"discord.js": "^13.7.0",
|
"discord.js": "^14.3.0",
|
||||||
"dotenv": "^16.0.1",
|
"dotenv": "^16.0.1",
|
||||||
"mariadb": "^3.0.1",
|
"mariadb": "^3.0.1",
|
||||||
"mysql2": "^2.3.3",
|
"mysql2": "^2.3.3",
|
||||||
"node-fetch": "^3.2.6",
|
"node-fetch": "^3.2.6",
|
||||||
|
"safe-regex": "github:davisjam/safe-regex",
|
||||||
"sequelize": "^6.21.3",
|
"sequelize": "^6.21.3",
|
||||||
"turndown": "^7.1.1",
|
"turndown": "^7.1.1",
|
||||||
"twit": "^2.2.11"
|
"twit": "^2.2.11"
|
||||||
|
|
Loading…
Reference in a new issue