Skip to content

Commit

Permalink
[backport] fix 2 errors with /calc and /av
Browse files Browse the repository at this point in the history
  • Loading branch information
retrixe committed Oct 16, 2021
1 parent 2af8182 commit fb0a376
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/bot/commands/games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ More info here: https://mathjs.org/docs/expressions/syntax.html`,
},
generator: (message, args) => {
try {
return `${evaluate(args.join(' ').split(',').join('.').split('÷').join('/').toLowerCase())}`
return `${evaluate(args.join(' ').split(',').join('.').split('÷').join('/').toLowerCase())}`.trim()
} catch (e) {
return { content: 'Invalid expression >_<', error: true }
}
Expand Down
2 changes: 1 addition & 1 deletion server/bot/commands/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,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 fb0a376

Please sign in to comment.