mirror of
https://github.com/Mestima/luna.git
synced 2025-05-05 21:50:15 +00:00
global codestyle refactoring: err -> e
This commit is contained in:
parent
874ad26c03
commit
cd26624454
@ -5,8 +5,8 @@ const cat = async () => {
|
||||
.then((res) => {
|
||||
return res.data.file;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -5,8 +5,8 @@ const fox = async () => {
|
||||
.then((res) => {
|
||||
return res.data.image;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -21,8 +21,8 @@ const InteractionHandler = class {
|
||||
});
|
||||
}
|
||||
return this;
|
||||
} catch(err) {
|
||||
throw err;
|
||||
} catch(e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,8 +41,8 @@ const InteractionHandler = class {
|
||||
.then(() => {
|
||||
console.log(`${chalk.green('Done:')} all commands are registered at the dev guild`);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(`${chalk.red('Error:')} ${err}`);
|
||||
.catch((e) => {
|
||||
console.log(`${chalk.red('Error:')} ${e}`);
|
||||
});
|
||||
}
|
||||
|
||||
@ -53,8 +53,8 @@ const InteractionHandler = class {
|
||||
.then(() => {
|
||||
console.log(`${chalk.green('Done:')} all commands are unregistered at the dev guild`);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(`${chalk.red('Error:')} ${err}`);
|
||||
.catch((e) => {
|
||||
console.log(`${chalk.red('Error:')} ${e}`);
|
||||
});
|
||||
}
|
||||
|
||||
@ -63,8 +63,8 @@ const InteractionHandler = class {
|
||||
.then(() => {
|
||||
console.log(`${chalk.green('Done:')} command '${commandId}' has been unregistered at the dev guild`);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(`${chalk.red('Error:')} ${err}`);
|
||||
.catch((e) => {
|
||||
console.log(`${chalk.red('Error:')} ${e}`);
|
||||
});
|
||||
}
|
||||
|
||||
@ -75,8 +75,8 @@ const InteractionHandler = class {
|
||||
.then(() => {
|
||||
console.log(`${chalk.green('Done:')} all commands are registered globally`);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(`${chalk.red('Error:')} ${err}`);
|
||||
.catch((e) => {
|
||||
console.log(`${chalk.red('Error:')} ${e}`);
|
||||
});
|
||||
}
|
||||
|
||||
@ -87,8 +87,8 @@ const InteractionHandler = class {
|
||||
.then(() => {
|
||||
console.log(`${chalk.green('Done:')} all commands are unregistered globally`);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(`${chalk.red('Error:')} ${err}`);
|
||||
.catch((e) => {
|
||||
console.log(`${chalk.red('Error:')} ${e}`);
|
||||
});
|
||||
}
|
||||
|
||||
@ -97,8 +97,8 @@ const InteractionHandler = class {
|
||||
.then(() => {
|
||||
console.log(`${chalk.green('Done:')} command '${commandId}' has been unregistered globally`);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(`${chalk.red('Error:')} ${err}`);
|
||||
.catch((e) => {
|
||||
console.log(`${chalk.red('Error:')} ${e}`);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -30,8 +30,8 @@ const PresenceHandler = class {
|
||||
await client.user.setPresence(presencePayload);
|
||||
|
||||
return { status: this.status, content: this.content, type: type };
|
||||
} catch (err) {
|
||||
throw err;
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -20,9 +20,9 @@ const LunaInteractionHandler = await new InteractionHandler().init(TOKEN)
|
||||
console.log(`${chalk.green('Done:')} InteractionHandler initialized successfully`)
|
||||
return handler;
|
||||
})
|
||||
.catch((err) => {
|
||||
.catch((e) => {
|
||||
console.log(`${chalk.red('Error:')} can not initialize InteractionHandler`)
|
||||
throw err;
|
||||
throw e;
|
||||
});
|
||||
const LunaAPIService = await new APIService().init();
|
||||
|
||||
@ -99,9 +99,9 @@ Luna.on(Discord.Events.ClientReady, async () => {
|
||||
.then((res) => {
|
||||
console.log(`${chalk.green('Done:')} PresenceHandler initialized successfully | status: ${res.status} | type: ${res.type} | content: ${res.content}`);
|
||||
})
|
||||
.catch((err) => {
|
||||
.catch((e) => {
|
||||
console.log(`${chalk.red('Error:')} can not initialize PresenceHandler`);
|
||||
throw err;
|
||||
throw e;
|
||||
});
|
||||
await LunaInteractionHandler.registerCommandsDev(CLIENT_ID, DEV_GUILD_ID);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user