Skip to content

Commit

Permalink
Fix 2 internal errors with /calc and /av.
Browse files Browse the repository at this point in the history
  • Loading branch information
retrixe committed Aug 31, 2021
1 parent 4c80771 commit 80b48e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/commands/games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ More info here: https://mathjs.org/docs/expressions/syntax.html`,
generator: (message, args) => handleCalculate.commonGenerator(args.join(' ')),
commonGenerator: (expression: string) => {
try {
return `${evaluate(expression.split(',').join('.').split('÷').join('/').toLowerCase())}`
return `${evaluate(expression.split(',').join('.').split('÷').join('/').toLowerCase())}`.trim()
} catch (e) {
return { content: 'Invalid expression >_<', error: true }
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ export const handleAvatar: Command = {
let user: Message['author'] = getUser(message, args.join(' ')) || message.author
if (!user && message.mentions.length !== 0) user = message.mentions[0]
const member = message.member.guild.members.get(user.id)
const format = user.avatar.startsWith('a_') ? 'gif' : 'png'
const format = user.avatar && user.avatar.startsWith('a_') ? 'gif' : 'png'
return {
content: '**Avatar:**',
embed: {
Expand Down

0 comments on commit 80b48e4

Please sign in to comment.