mirror of
https://github.com/System-End/Discord-Bot.git
synced 2026-04-19 16:28:26 +00:00
Fixed custom event bug
This commit is contained in:
parent
bd1ed74877
commit
2253c018f6
1 changed files with 4 additions and 0 deletions
|
|
@ -17,7 +17,11 @@ module.exports = (client) => {
|
|||
const event = require(`../../events/${dirs}/${file}`);
|
||||
const eventName = file.split(".")[0];
|
||||
const eventUpperCase = eventName.charAt(0).toUpperCase() + eventName.slice(1);
|
||||
if(Discord.Events[eventUpperCase] === undefined){
|
||||
client.on(eventName, event.bind(null, client)).setMaxListeners(0);
|
||||
}else {
|
||||
client.on(Discord.Events[eventUpperCase], event.bind(null, client)).setMaxListeners(0);
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue