diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-07 09:47:14 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-07 09:47:14 -0400 |
commit | 1b6d56162bae1d9119f0641df1092ab6a92df620 (patch) | |
tree | 2596f6f949b7b727df699d2c1856d54349ba1da7 /src/listeners | |
parent | 6c9d967ae526a4a1eee1754a82b09dbadb218f82 (diff) | |
download | tanzanite-1b6d56162bae1d9119f0641df1092ab6a92df620.tar.gz tanzanite-1b6d56162bae1d9119f0641df1092ab6a92df620.tar.bz2 tanzanite-1b6d56162bae1d9119f0641df1092ab6a92df620.zip |
fix config being owner only, fix direct message id footer and fix leveing listner not saving new entries
Diffstat (limited to 'src/listeners')
-rw-r--r-- | src/listeners/message/directMessage.ts | 5 | ||||
-rw-r--r-- | src/listeners/message/level.ts | 3 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/listeners/message/directMessage.ts b/src/listeners/message/directMessage.ts index 93ab662..5da55ec 100644 --- a/src/listeners/message/directMessage.ts +++ b/src/listeners/message/directMessage.ts @@ -14,7 +14,7 @@ export default class DirectMessageListener extends BushListener { public override async exec(...[message]: BushClientEvents['messageCreate']): Promise<void> { if (message.channel.type === 'DM') { if (!(message.author.id == client.user!.id) && message.author.bot) return; - const dmLogEmbed = new MessageEmbed().setTimestamp().setFooter(`User ID • ${message.author.id}`); + const dmLogEmbed = new MessageEmbed().setTimestamp().setFooter(`User ID • ${message.channel.recipient.id}`); if (message.author.id != client.user!.id) { dmLogEmbed @@ -29,8 +29,7 @@ export default class DirectMessageListener extends BushListener { ) .setDescription(`**DM:**\n${message}`) .setColor(util.colors.red) - .setTimestamp() - .setFooter(`ID • ${message.author.id}`); + .setTimestamp(); } if (message.attachments.filter((a) => typeof a.size == 'number').size == 1) { dmLogEmbed.setImage(message.attachments.filter((a) => typeof a.size == 'number').first()!.proxyURL); diff --git a/src/listeners/message/level.ts b/src/listeners/message/level.ts index e567932..7004d52 100644 --- a/src/listeners/message/level.ts +++ b/src/listeners/message/level.ts @@ -29,7 +29,8 @@ export default class LevelListener extends BushListener { } }); const xpToGive = Level.genRandomizedXp(); - const success = await user.increment('xp', { by: xpToGive }).catch((e) => { + user.xp = user.xp + xpToGive; + const success = await user.save().catch((e) => { void util.handleError('level', e); return false; }); |