Skip to content

Commit

Permalink
Calculator and Element is working now
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyYam committed Nov 24, 2021
1 parent 2dace1a commit c5de638
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/commands/Educative/Calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default class Command extends BaseCommand {
run = async (M: ISimplifiedMessage, { joined }: IParsedArgs): Promise<void> => {
if (!joined) return void M.reply('Provide the value to calculate, Baka!')
const value = joined.trim()
const cal = evaluate(value);
const text = `💡 *Solution for ${value} = ${cal}*`;
const calc = evaluate(value);
const text = `💡 *Solution for ${value} = ${calc}*`;
await M.reply(text)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.catch((reason: any) => M.reply(`${reason}`))
Expand Down
5 changes: 2 additions & 3 deletions src/commands/Educative/Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default class Command extends BaseCommand {
return void M.reply("Give me an element name/number/symbol, Baka!");
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const chitoge: any = joined.trim();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const search = await pTable(chitoge);
console.log(search);
if (search === undefined) {
Expand All @@ -35,9 +36,7 @@ export default class Command extends BaseCommand {
));
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const response = await npt.getByNumber(search.number).catch((err: any) => {
return void M.reply(`✖ An error occurred. Reason: *${err}*`);
});
const response = await npt.getByNumber(search.number);
let text = "";
text += `🔴 *Elelment: ${response.name}*\n`;
text += `⬜ *Atomic Number: ${response.number}*\n`;
Expand Down

0 comments on commit c5de638

Please sign in to comment.