aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moulberry-bush/level.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-17 10:25:46 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-17 10:25:46 -0400
commitd1724227abfb8f0fcd9e573f7e9772cf0be8257a (patch)
tree52c9dbae1fbbbd3c777d9c16ab643c477141ae21 /src/commands/moulberry-bush/level.ts
parent53d2b18f7f73d5696fb7cd86d1c164a790dfdcc3 (diff)
downloadtanzanite-d1724227abfb8f0fcd9e573f7e9772cf0be8257a.tar.gz
tanzanite-d1724227abfb8f0fcd9e573f7e9772cf0be8257a.tar.bz2
tanzanite-d1724227abfb8f0fcd9e573f7e9772cf0be8257a.zip
honestly no idea what I did at this point
Diffstat (limited to 'src/commands/moulberry-bush/level.ts')
-rw-r--r--src/commands/moulberry-bush/level.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/commands/moulberry-bush/level.ts b/src/commands/moulberry-bush/level.ts
index fc1e93e..86ab985 100644
--- a/src/commands/moulberry-bush/level.ts
+++ b/src/commands/moulberry-bush/level.ts
@@ -1,4 +1,4 @@
-import { BushCommand, BushMessage, BushSlashMessage, BushUser, Level } from '@lib';
+import { BushCommand, BushGuild, BushMessage, BushSlashMessage, BushUser, Level } from '@lib';
/*
import canvas from 'canvas';
import { MessageAttachment } from 'discord.js';
@@ -127,8 +127,8 @@ export default class LevelCommand extends BushCommand {
return image.toBuffer();
} */
- private async getResponse(user: BushUser): Promise<string> {
- const userLevelRow = await Level.findByPk(user.id);
+ private async getResponse(user: BushUser, guild: BushGuild): Promise<string> {
+ const userLevelRow = await Level.findOne({ where: { user: user.id, guild: guild.id } });
if (userLevelRow) {
return `${user ? `${user.tag}'s` : 'Your'} level is ${userLevelRow.level} (${userLevelRow.xp} XP)`;
} else {
@@ -143,6 +143,6 @@ export default class LevelCommand extends BushCommand {
// 'lel.png'
// )
// );
- await message.reply(await this.getResponse(user || message.author));
+ await message.reply(await this.getResponse(user || message.author, message.guild));
}
}