mirror of
https://github.com/System-End/Discord-Bot.git
synced 2026-04-19 16:28:26 +00:00
Fixed some errors
This commit is contained in:
parent
cfb97ca88b
commit
08fdcc0730
22 changed files with 47 additions and 43 deletions
|
|
@ -227,7 +227,7 @@ process.on('warning', warn => {
|
|||
})
|
||||
});
|
||||
|
||||
client.on('shardError', error => {
|
||||
client.on(Discord.ShardEvents.Error, error => {
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setTitle(`🚨・A websocket connection encountered an error`)
|
||||
.addFields([
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ const Discord = require('discord.js');
|
|||
const Voice = require('@discordjs/voice');
|
||||
|
||||
module.exports = (client) => {
|
||||
client.on('interactionCreate', async (interaction) => {
|
||||
client.on(Discord.Events.InteractionCreate, async (interaction) => {
|
||||
if (interaction.isButton()) {
|
||||
if (interaction.customId == "Bot-musicpause") {
|
||||
interaction.deferUpdate();
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ module.exports = (client) => {
|
|||
client.startStream(process.env.RADIO || "https://playerservices.streamtheworld.com/api/livestream-redirect/RADIO538");
|
||||
});
|
||||
|
||||
client.on('ready', async () => {
|
||||
client.on(Discord.Events.ClientReady, async () => {
|
||||
client.startStream(process.env.RADIO || "https://playerservices.streamtheworld.com/api/livestream-redirect/RADIO538");
|
||||
|
||||
Schema.find(async (err, data) => {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ module.exports = async (client) => {
|
|||
}
|
||||
}
|
||||
|
||||
client.on('guildMemberUpdate', (oldMember, newMember) => {
|
||||
client.on(Discord.Events.GuildMemberUpdate, (oldMember, newMember) => {
|
||||
if (!oldMember.premiumSince && newMember.premiumSince) {
|
||||
client.emit('guildMemberBoost', newMember);
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@ module.exports = async (client) => {
|
|||
}
|
||||
})
|
||||
|
||||
client.on('guildUpdate', (oldGuild, newGuild) => {
|
||||
client.on(Discord.Events.GuildUpdate, (oldGuild, newGuild) => {
|
||||
if (oldGuild.premiumTier < newGuild.premiumTier) {
|
||||
client.emit('guildBoostLevelUp', newGuild, oldGuild.premiumTier, newGuild.premiumTier);
|
||||
}
|
||||
|
|
@ -53,7 +53,7 @@ module.exports = async (client) => {
|
|||
}
|
||||
})
|
||||
|
||||
client.on('roleUpdate', (oldRole, newRole) => {
|
||||
client.on(Discord.Events.RoleUpdate, (oldRole, newRole) => {
|
||||
if (oldRole.rawPosition !== newRole.rawPosition) {
|
||||
client.emit('rolePositionUpdate', newRole, oldRole.rawPosition, newRole.rawPosition);
|
||||
}
|
||||
|
|
@ -71,7 +71,7 @@ module.exports = async (client) => {
|
|||
}
|
||||
})
|
||||
|
||||
client.on('channelUpdate', (oldChannel, newChannel) => {
|
||||
client.on(Discord.Events.ChannelUpdate, (oldChannel, newChannel) => {
|
||||
if (oldChannel.type === Discord.ChannelType.GuildText && oldChannel.topic !== newChannel.topic) {
|
||||
client.emit('channelTopicUpdate', newChannel, oldChannel.topic, newChannel.topic);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ const Discord = require("discord.js");
|
|||
module.exports = async (client) => {
|
||||
const guildInvites = new Map();
|
||||
|
||||
client.on('inviteCreate', async invite => {
|
||||
client.on(Discord.Events.InviteCreate, async invite => {
|
||||
try {
|
||||
const invites = await invite.guild.invites.fetch().catch(() => { });
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ module.exports = async (client) => {
|
|||
catch { }
|
||||
})
|
||||
|
||||
client.once('ready', async () => {
|
||||
client.once(Discord.Events.ClientReady, async () => {
|
||||
try {
|
||||
const Guilds = client.guilds.cache.map(guild => guild.id);
|
||||
let i = 0;
|
||||
|
|
@ -37,7 +37,7 @@ module.exports = async (client) => {
|
|||
} catch (e) { }
|
||||
});
|
||||
|
||||
client.on('guildMemberAdd', async member => {
|
||||
client.on(Discord.Events.GuildMemberAdd, async member => {
|
||||
try {
|
||||
const cachedInvites = guildInvites.get(member.guild.id)
|
||||
const newInvites = await member.guild.invites.fetch().catch(() => { });
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
const Schema = require("../../database/models/stats");
|
||||
const Discord = require('discord.js');
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.getTemplate = async (guild) => {
|
||||
|
|
@ -17,23 +18,23 @@ module.exports = async (client) => {
|
|||
}
|
||||
}
|
||||
|
||||
client.on('guildMemberAdd', async (member) => {
|
||||
client.on(Discord.Events.GuildMemberAdd, async (member) => {
|
||||
client.emit('updateMembers', member.guild);
|
||||
client.emit('updateBots', member.guild);
|
||||
})
|
||||
client.on('guildMemberRemove', async (member) => {
|
||||
client.on(Discord.Events.GuildMemberRemove, async (member) => {
|
||||
client.emit('updateMembers', member.guild);
|
||||
client.emit('updateBots', member.guild);
|
||||
})
|
||||
|
||||
client.on('channelCreate', async channel => {
|
||||
client.on(Discord.Events.ChannelCreate, async channel => {
|
||||
client.emit('updateChannels', channel, channel.guild);
|
||||
client.emit('updateNewsChannels', channel, channel.guild);
|
||||
client.emit('updateStageChannels', channel, channel.guild);
|
||||
client.emit('updateTextChannels', channel, channel.guild);
|
||||
client.emit('updateVoiceChannels', channel, channel.guild);
|
||||
})
|
||||
client.on('channelDelete', async channel => {
|
||||
client.on(Discord.Events.ChannelDelete, async channel => {
|
||||
client.emit('updateChannels', channel, channel.guild);
|
||||
client.emit('updateNewsChannels', channel, channel.guild);
|
||||
client.emit('updateStageChannels', channel, channel.guild);
|
||||
|
|
@ -41,27 +42,27 @@ module.exports = async (client) => {
|
|||
client.emit('updateVoiceChannels', channel, channel.guild);
|
||||
})
|
||||
|
||||
client.on('roleCreate', async role => client.emit('updateRoles', role.guild))
|
||||
client.on('roleDelete', async role => client.emit('updateRoles', role.guild))
|
||||
client.on(Discord.Events.RoleCreate, async role => client.emit('updateRoles', role.guild))
|
||||
client.on(Discord.Events.RoleDelete, async role => client.emit('updateRoles', role.guild))
|
||||
|
||||
client.on('guildMemberBoost', (booster) => client.emit('updateBoosts', booster.guild))
|
||||
client.on('guildMemberUnboost', (booster) => client.emit('updateBoosts', booster.guild))
|
||||
client.on(Discord.Events.GuildMemberBoost, (booster) => client.emit('updateBoosts', booster.guild))
|
||||
client.on(Discord.Events.GuildMemberUnboost, (booster) => client.emit('updateBoosts', booster.guild))
|
||||
|
||||
client.on('guildBoostLevelUp', (tier) => client.emit('updateTier', tier.guild))
|
||||
client.on('guildBoostLevelDown', (tier) => client.emit('updateTier', tier.guild))
|
||||
client.on(Discord.Events.GuildBoostLevelUp, (tier) => client.emit('updateTier', tier.guild))
|
||||
client.on(Discord.Events.GuildBoostLevelDown, (tier) => client.emit('updateTier', tier.guild))
|
||||
|
||||
client.on('emojiCreate', (emoji) => {
|
||||
client.on(Discord.Events.EmojiCreate, (emoji) => {
|
||||
client.emit('updateEmojis', emoji, emoji.guild);
|
||||
client.emit('updateAEmojis', emoji, emoji.guild);
|
||||
client.emit('updateSEmojis', emoji, emoji.guild);
|
||||
})
|
||||
client.on('emojiDelete', (emoji) => {
|
||||
client.on(Discord.Events.EmojiDelete, (emoji) => {
|
||||
client.emit('updateEmojis', emoji, emoji.guild);
|
||||
client.emit('updateAEmojis', emoji, emoji.guild);
|
||||
client.emit('updateSEmojis', emoji, emoji.guild);
|
||||
})
|
||||
|
||||
client.on('ready', async client => client.emit('updateClock'))
|
||||
client.on(Discord.Events.ClientReady, async client => client.emit('updateClock'))
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
const discord = require('discord.js');
|
||||
const Discord = require('discord.js');
|
||||
|
||||
const Schema = require("../../database/models/guessNumber");
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.on('messageCreate', async (message) => {
|
||||
client.on(Discord.Events.MessageCreate, async (message) => {
|
||||
if (message.author.bot || message.channel.type === 'DM') return;
|
||||
|
||||
const data = await Schema.findOne({ Guild: message.guild.id, Channel: message.channel.id })
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
const discord = require('discord.js');
|
||||
const Discord = require('discord.js');
|
||||
|
||||
const Schema = require("../../database/models/guessWord");
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.on('messageCreate', async (message) => {
|
||||
client.on(Discord.Events.MessageCreate, async (message) => {
|
||||
if (message.author.bot || message.channel.type === 'DM') return;
|
||||
|
||||
let wordList = client.config.wordList;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
const discord = require('discord.js');
|
||||
const Discord = require('discord.js');
|
||||
|
||||
const Schema = require("../../database/models/wordsnake");
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.on('messageCreate', async (message) => {
|
||||
client.on(Discord.Events.MessageCreate, async (message) => {
|
||||
if (message.author.bot || message.channel.type === 'DM') return;
|
||||
|
||||
Schema.findOne({ Guild: message.guild.id, Channel: message.channel.id }, async (err, data) => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
const Discord = require('discord.js');
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.on('interactionCreate', async (interaction) => {
|
||||
client.on(Discord.Events.InteractionCreate, async (interaction) => {
|
||||
if (!interaction.isStringSelectMenu()) return;
|
||||
|
||||
if (interaction.customId == "Bot-helppanel") {
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ module.exports = async (client) => {
|
|||
},
|
||||
];
|
||||
|
||||
client.on('interactionCreate', async (interaction) => {
|
||||
client.on(Discord.Events.InteractionCreate, async (interaction) => {
|
||||
if (!interaction.isStringSelectMenu()) return;
|
||||
|
||||
if (interaction.customId == "Bot-helppanel") {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
const Discord = require('discord.js');
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.on('interactionCreate', async (interaction) => {
|
||||
client.on(Discord.Events.InteractionCreate, async (interaction) => {
|
||||
if (!interaction.isStringSelectMenu()) return;
|
||||
|
||||
if (interaction.customId == "Bot-helppanel") {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
const Discord = require('discord.js');
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.on('interactionCreate', async (interaction) => {
|
||||
client.on(Discord.Events.InteractionCreate, async (interaction) => {
|
||||
if (!interaction.isStringSelectMenu()) return;
|
||||
|
||||
if (interaction.customId == "Bot-helppanel") {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
const Discord = require('discord.js');
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.on('interactionCreate', async (interaction) => {
|
||||
client.on(Discord.Events.InteractionCreate, async (interaction) => {
|
||||
if (!interaction.isStringSelectMenu()) return;
|
||||
|
||||
if (interaction.customId == "Bot-linkspanel") {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
const Discord = require('discord.js');
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.on('interactionCreate', async (interaction) => {
|
||||
client.on(Discord.Events.InteractionCreate, async (interaction) => {
|
||||
if (!interaction.isStringSelectMenu()) return;
|
||||
|
||||
if (interaction.customId == "Bot-linkspanel") {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
const Discord = require('discord.js');
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.on('interactionCreate', async (interaction) => {
|
||||
client.on(Discord.Events.InteractionCreate, async (interaction) => {
|
||||
if (!interaction.isStringSelectMenu()) return;
|
||||
|
||||
if (interaction.customId == "Bot-linkspanel") {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
const Discord = require('discord.js');
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.on('interactionCreate', async (interaction) => {
|
||||
client.on(Discord.Events.InteractionCreate, async (interaction) => {
|
||||
if (!interaction.isStringSelectMenu()) return;
|
||||
|
||||
if (interaction.customId == "Bot-linkspanel") {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
const Discord = require('discord.js');
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.on('interactionCreate', async (interaction) => {
|
||||
client.on(Discord.Events.InteractionCreate, async (interaction) => {
|
||||
if (!interaction.isStringSelectMenu()) return;
|
||||
|
||||
if (interaction.customId == "Bot-linkspanel") {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
const chalk = require('chalk');
|
||||
const fs = require('fs');
|
||||
const Discord = require('discord.js');
|
||||
|
||||
module.exports = (client) => {
|
||||
|
||||
|
|
@ -14,7 +15,9 @@ module.exports = (client) => {
|
|||
|
||||
for (const file of events) {
|
||||
const event = require(`../../events/${dirs}/${file}`);
|
||||
client.on(file.split(".")[0], event.bind(null, client)).setMaxListeners(0);
|
||||
const eventName = file.split(".")[0];
|
||||
const eventUpperCase = eventName.charAt(0).toUpperCase() + eventName.slice(1);
|
||||
client.on(Discord.Events[eventUpperCase], event.bind(null, client));
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ const Schema = require("../../database/models/functions");
|
|||
const Schema2 = require("../../database/models/channelList");
|
||||
|
||||
module.exports = (client) => {
|
||||
client.on('messageCreate', async (message) => {
|
||||
client.on(Discord.Events.MessageCreate, async (message) => {
|
||||
if (message.channel.type === 'DM') return;
|
||||
Schema.findOne({ Guild: message.guild.id }, async (err, data) => {
|
||||
if (data) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ const TIME = 10000;
|
|||
const DIFF = 3000;
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.on('messageCreate', async (message) => {
|
||||
client.on(Discord.Events.MessageCreate, async (message) => {
|
||||
if (message.author.bot || message.channel.type === 'DM') return;
|
||||
|
||||
Schema.findOne({ Guild: message.guild.id }, async (err, data) => {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ const BlackList = require("../../database/models/blacklist");
|
|||
const { blacklistedWords } = require("../../Collection");
|
||||
|
||||
module.exports = async (client) => {
|
||||
client.on('messageCreate', async (message) => {
|
||||
client.on(Discord.Events.MessageCreate, async (message) => {
|
||||
if (message.channel.type === 'DM') return;
|
||||
|
||||
try {
|
||||
|
|
@ -31,7 +31,7 @@ module.exports = async (client) => {
|
|||
catch { }
|
||||
}).setMaxListeners(0);
|
||||
|
||||
client.on('messageUpdate', async (oldMessage, newMessage) => {
|
||||
client.on(Discord.Events.MessageUpdate, async (oldMessage, newMessage) => {
|
||||
if (oldMessage.content === newMessage.content) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue