diff --git a/Events/followRequest.js b/Events/followRequest.js index 4e03efb..9803c45 100644 --- a/Events/followRequest.js +++ b/Events/followRequest.js @@ -4,7 +4,7 @@ module.exports = class { } async emit(user) { - console.log(`${user.fullName} (${user.username}) wants to follow you.`) + this.client.logger.log(`${user.fullName} (${user.username}) wants to follow you.`, `log`) user.approveFollow(); } } diff --git a/Events/likeAdd.js b/Events/likeAdd.js index 53fb06f..600b2c8 100644 --- a/Events/likeAdd.js +++ b/Events/likeAdd.js @@ -4,6 +4,6 @@ module.exports = class { } async emit(user, message) { - console.log(`${user.fullName} (${user.username}) liked a message from ${message.author.fullName} (${message.author.username})`) + this.client.logger.log(`${user.fullName} (${user.username}) liked a message from ${message.author.fullName} (${message.author.username})`, `log`) } } diff --git a/Events/likeRemove.js b/Events/likeRemove.js index 6fa0a73..d99243a 100644 --- a/Events/likeRemove.js +++ b/Events/likeRemove.js @@ -4,6 +4,6 @@ module.exports = class { } async emit(user, message) { - console.log(`${user.fullName} (${user.username}) disliked a message from ${message.author.fullName} (${message.author.username})`) + this.client.logger.log(`${user.fullName} (${user.username}) disliked a message from ${message.author.fullName} (${message.author.username})`, `log`) } } diff --git a/Events/messageDelete.js b/Events/messageDelete.js index ae40947..4c9c4d9 100644 --- a/Events/messageDelete.js +++ b/Events/messageDelete.js @@ -5,6 +5,6 @@ module.exports = class { async emit(cachedMessage) { if (!cachedMessage) return; - console.log(`@${cachedMessage.author.username} has just deleted their message: ${cachedMessage.content}`); + this.client.logger.log(`@${cachedMessage.author.username} has just deleted their message: ${cachedMessage.content}`, `log`); } } diff --git a/Events/newFollower.js b/Events/newFollower.js index 89fd6ed..e9e457b 100644 --- a/Events/newFollower.js +++ b/Events/newFollower.js @@ -4,7 +4,7 @@ module.exports = class { } async emit(user) { - console.log(`${user.fullName} (${user.username}) started following you.`) + this.client.logger.log(`${user.fullName} (${user.username}) started following you.`, `log`) user.follow(); } } diff --git a/index.js b/index.js index 8afbab4..b588654 100644 --- a/index.js +++ b/index.js @@ -36,9 +36,26 @@ const initialize = async () => { }; initialize(); -client.logger.log(` ___ _ `) -client.logger.log(` |_ _|_ __ ___| |_ __ _ __ _ _ __ __ _ _ __ ___ `) -client.logger.log(` | || '_ \\/ __| __/ _\` |/ _\` | '__/ _\` | '_ \` _ \\ `) -client.logger.log(` | || | | \\__ \\ || (_| | (_| | | | (_| | | | | | |`) -client.logger.log(` |___|_| |_|___/\\__\\__,_|\\__, |_| \\__,_|_| |_| |_|`) -client.logger.log(` |___/ `) \ No newline at end of file +client.logger.log(` ___ _ `); +client.logger.log(` |_ _|_ __ ___| |_ __ _ __ _ _ __ __ _ _ __ ___ `); +client.logger.log(` | || '_ \\/ __| __/ _\` |/ _\` | '__/ _\` | '_ \` _ \\ `); +client.logger.log(` | || | | \\__ \\ || (_| | (_| | | | (_| | | | | | |`); +client.logger.log(` |___|_| |_|___/\\__\\__,_|\\__, |_| \\__,_|_| |_| |_|`); +client.logger.log(` |___/ `); + +process.on(`uncaughtException`, (error) => { + if (!client) return; + client.logger.log(`uncaughtException\n` + error.message); +}); +process.on(`unhandledRejection`, (listener) => { + if (!client) return; + client.logger.log(`unhandledRejection\n` + listener.message); +}); +process.on(`rejectionHandled`, (listener) => { + if (!client) return; + client.logger.log(`rejectionHandled\n` + listener.message); +}); +process.on(`warning`, (warning) => { + if (!client) return; + client.logger.log(`warning\n` + warning.message); +}); \ No newline at end of file diff --git a/package.json b/package.json index c7c0bd1..9a02114 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "instabot", - "version": "1.2.1", + "version": "1.2.6", "description": "A fully working instagram bot using Insta.js by androz2091", "main": "index.js", "scripts": {