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) => {
|
.then((res) => {
|
||||||
return res.data.file;
|
return res.data.file;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((e) => {
|
||||||
console.log(err);
|
console.log(e);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ const fox = async () => {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
return res.data.image;
|
return res.data.image;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((e) => {
|
||||||
console.log(err);
|
console.log(e);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ const InteractionHandler = class {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
} catch(err) {
|
} catch(e) {
|
||||||
throw err;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,8 +41,8 @@ const InteractionHandler = class {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
console.log(`${chalk.green('Done:')} all commands are registered at the dev guild`);
|
console.log(`${chalk.green('Done:')} all commands are registered at the dev guild`);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((e) => {
|
||||||
console.log(`${chalk.red('Error:')} ${err}`);
|
console.log(`${chalk.red('Error:')} ${e}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,8 +53,8 @@ const InteractionHandler = class {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
console.log(`${chalk.green('Done:')} all commands are unregistered at the dev guild`);
|
console.log(`${chalk.green('Done:')} all commands are unregistered at the dev guild`);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((e) => {
|
||||||
console.log(`${chalk.red('Error:')} ${err}`);
|
console.log(`${chalk.red('Error:')} ${e}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,8 +63,8 @@ const InteractionHandler = class {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
console.log(`${chalk.green('Done:')} command '${commandId}' has been unregistered at the dev guild`);
|
console.log(`${chalk.green('Done:')} command '${commandId}' has been unregistered at the dev guild`);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((e) => {
|
||||||
console.log(`${chalk.red('Error:')} ${err}`);
|
console.log(`${chalk.red('Error:')} ${e}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,8 +75,8 @@ const InteractionHandler = class {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
console.log(`${chalk.green('Done:')} all commands are registered globally`);
|
console.log(`${chalk.green('Done:')} all commands are registered globally`);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((e) => {
|
||||||
console.log(`${chalk.red('Error:')} ${err}`);
|
console.log(`${chalk.red('Error:')} ${e}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,8 +87,8 @@ const InteractionHandler = class {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
console.log(`${chalk.green('Done:')} all commands are unregistered globally`);
|
console.log(`${chalk.green('Done:')} all commands are unregistered globally`);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((e) => {
|
||||||
console.log(`${chalk.red('Error:')} ${err}`);
|
console.log(`${chalk.red('Error:')} ${e}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,8 +97,8 @@ const InteractionHandler = class {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
console.log(`${chalk.green('Done:')} command '${commandId}' has been unregistered globally`);
|
console.log(`${chalk.green('Done:')} command '${commandId}' has been unregistered globally`);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((e) => {
|
||||||
console.log(`${chalk.red('Error:')} ${err}`);
|
console.log(`${chalk.red('Error:')} ${e}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -30,8 +30,8 @@ const PresenceHandler = class {
|
|||||||
await client.user.setPresence(presencePayload);
|
await client.user.setPresence(presencePayload);
|
||||||
|
|
||||||
return { status: this.status, content: this.content, type: type };
|
return { status: this.status, content: this.content, type: type };
|
||||||
} catch (err) {
|
} catch (e) {
|
||||||
throw err;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -20,9 +20,9 @@ const LunaInteractionHandler = await new InteractionHandler().init(TOKEN)
|
|||||||
console.log(`${chalk.green('Done:')} InteractionHandler initialized successfully`)
|
console.log(`${chalk.green('Done:')} InteractionHandler initialized successfully`)
|
||||||
return handler;
|
return handler;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((e) => {
|
||||||
console.log(`${chalk.red('Error:')} can not initialize InteractionHandler`)
|
console.log(`${chalk.red('Error:')} can not initialize InteractionHandler`)
|
||||||
throw err;
|
throw e;
|
||||||
});
|
});
|
||||||
const LunaAPIService = await new APIService().init();
|
const LunaAPIService = await new APIService().init();
|
||||||
|
|
||||||
@ -99,9 +99,9 @@ Luna.on(Discord.Events.ClientReady, async () => {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(`${chalk.green('Done:')} PresenceHandler initialized successfully | status: ${res.status} | type: ${res.type} | content: ${res.content}`);
|
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`);
|
console.log(`${chalk.red('Error:')} can not initialize PresenceHandler`);
|
||||||
throw err;
|
throw e;
|
||||||
});
|
});
|
||||||
await LunaInteractionHandler.registerCommandsDev(CLIENT_ID, DEV_GUILD_ID);
|
await LunaInteractionHandler.registerCommandsDev(CLIENT_ID, DEV_GUILD_ID);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user