Fixed some issues regarding eris-sharder and newer eris versions

This commit is contained in:
TheEssem 2021-04-29 16:56:32 -05:00
parent 33808685f3
commit 19922858f2
16 changed files with 61 additions and 56 deletions

View file

@ -2,7 +2,7 @@ const db = require("../utils/database.js");
const logger = require("../utils/logger.js");
// run when the bot is added to a guild
module.exports = async (client, guild) => {
module.exports = async (client, cluster, ipc, guild) => {
logger.log("info", `[GUILD JOIN] ${guild.name} (${guild.id}) added the bot.`);
await db.addGuild(guild);
};

View file

@ -1,6 +1,6 @@
const logger = require("../utils/logger.js");
// run when the bot is removed from a guild
module.exports = async (client, guild) => {
module.exports = async (client, cluster, ipc, guild) => {
logger.log(`[GUILD LEAVE] ${guild.name} (${guild.id}) removed the bot.`);
};

View file

@ -5,7 +5,7 @@ const collections = require("../utils/collections.js");
const commands = [...collections.aliases.keys(), ...collections.commands.keys()];
// run when someone sends a message
module.exports = async (client, message) => {
module.exports = async (client, cluster, ipc, message) => {
// ignore dms and other bots
if (message.author.bot) return;
@ -85,7 +85,7 @@ module.exports = async (client, message) => {
try {
await database.addCount(collections.aliases.has(command) ? collections.aliases.get(command) : command);
const startTime = new Date();
const commandClass = new cmd(client, message, args, message.content.substring(prefix.length).trim().replace(command, "").trim());
const commandClass = new cmd(client, cluster, ipc, message, args, message.content.substring(prefix.length).trim().replace(command, "").trim());
const result = await commandClass.run(); // we also provide the message content as a parameter for cases where we need more accuracy
const endTime = new Date();
if (typeof result === "string" || (typeof result === "object" && result.embed)) {

View file

@ -1,7 +1,7 @@
const player = require("../utils/soundplayer.js");
// run when a raw packet is sent, used for sending data to lavalink
module.exports = async (client, packet) => {
module.exports = async (client, cluster, ipc, packet) => {
if (!player.manager) return;
switch (packet.t) {
case "VOICE_SERVER_UPDATE":

View file

@ -2,7 +2,7 @@ const soundPlayer = require("../utils/soundplayer.js");
const AwaitRejoin = require("../utils/awaitrejoin.js");
const { random } = require("../utils/misc.js");
module.exports = async (client, member, oldChannel) => {
module.exports = async (client, cluster, ipc, member, oldChannel) => {
const connection = soundPlayer.players.get(oldChannel.guild.id);
if (connection && connection.type === "music" && oldChannel.id === connection.voiceChannel.id) {
if (oldChannel.voiceMembers.filter((i) => i.id !== client.user.id).length === 0) {

View file

@ -1,5 +1,5 @@
const leaveHandler = require("./voiceChannelLeave.js");
module.exports = async (client, member, newChannel, oldChannel) => {
await leaveHandler(client, member, oldChannel);
module.exports = async (client, cluster, ipc, member, newChannel, oldChannel) => {
await leaveHandler(client, cluster, ipc, member, oldChannel);
};