aboutsummaryrefslogtreecommitdiff
path: root/src/tasks
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-31 13:46:27 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-31 13:46:27 -0400
commitedcc0dd0a9228192ff6c4f6d6797dd6238e98f92 (patch)
tree70c3f5436342d7f6b0e81222467d2773a3bb0b33 /src/tasks
parentb63a6b0cb61f0abf8a946a7f0f04a2a19a31e690 (diff)
downloadtanzanite-edcc0dd0a9228192ff6c4f6d6797dd6238e98f92.tar.gz
tanzanite-edcc0dd0a9228192ff6c4f6d6797dd6238e98f92.tar.bz2
tanzanite-edcc0dd0a9228192ff6c4f6d6797dd6238e98f92.zip
upgraded to typescript 4.3.5
The reason I had to use getters and setters for the db models is because in the newer version of typescript the properties would be defined at runtime and override the getter and setters that sequalize uses later, causing all the values to be undefined and not being able to save any information.
Diffstat (limited to 'src/tasks')
-rw-r--r--src/tasks/removeExpiredPunishements.ts6
-rw-r--r--src/tasks/updateCache.ts2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/tasks/removeExpiredPunishements.ts b/src/tasks/removeExpiredPunishements.ts
index fc3708d..3d7528b 100644
--- a/src/tasks/removeExpiredPunishements.ts
+++ b/src/tasks/removeExpiredPunishements.ts
@@ -1,4 +1,4 @@
-import { BushGuild, BushGuildMember, BushTask } from '@lib';
+import { BushGuild, BushTask } from '@lib';
import { Op } from 'sequelize';
import { ActivePunishment, ActivePunishmentType } from '../lib/models/ActivePunishment';
@@ -9,7 +9,7 @@ export default class RemoveExpiredPunishmentsTask extends BushTask {
runOnStart: true
});
}
- async exec(): Promise<void> {
+ public override async exec(): Promise<void> {
const expiredEntries = await ActivePunishment.findAll({
where: {
[Op.and]: [
@@ -29,7 +29,7 @@ export default class RemoveExpiredPunishmentsTask extends BushTask {
for (const entry of expiredEntries) {
const guild = client.guilds.cache.get(entry.guild) as BushGuild;
- const member = guild.members.cache.get(entry.user) as BushGuildMember;
+ const member = guild.members.cache.get(entry.user);
if (!guild) {
await entry.destroy();
diff --git a/src/tasks/updateCache.ts b/src/tasks/updateCache.ts
index 9ca7926..95ceca1 100644
--- a/src/tasks/updateCache.ts
+++ b/src/tasks/updateCache.ts
@@ -11,7 +11,7 @@ export class UpdateCacheTask extends BushTask {
runOnStart: false // done in preinit task
});
}
- public async exec(): Promise<void> {
+ public override async exec(): Promise<void> {
await UpdateCacheTask.updateGlobalCache(client);
await UpdateCacheTask.updateGuildCache(client);
void client.logger.verbose(`UpdateCache`, `Updated cache.`);