Skip to content

Commit 40ca891

Browse files
committed
add reminder channels to bot configuration
1 parent 40432f9 commit 40ca891

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/controllers/discord/bot.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ router.get(
165165
}
166166

167167
const configs = await DiscordConfigModel.find({ type: 'discord' })
168+
.lean()
168169
.cache('6 hours', 'discord-configs')
169170
.exec();
170171
return res.status(status.OK).json(configs);
@@ -189,6 +190,7 @@ router.get(
189190
}
190191

191192
const config = await DiscordConfigModel.findOne({ type: 'discord', id: id })
193+
.lean()
192194
.cache('6 hours', `discord-config-${id}`)
193195
.exec();
194196
if (!config) {
@@ -200,6 +202,7 @@ router.get(
200202
ironMic: { channelId: '', messageId: '' },
201203
onlineControllers: { channelId: '', messageId: '' },
202204
cleanupChannels: {},
205+
reminderChannels: {},
203206
});
204207
}
205208

src/models/discordConfig.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ interface IDiscordConfig extends Document {
1818
ironMic: IUpdatableMessage;
1919
onlineControllers: IUpdatableMessage;
2020
cleanupChannels: object;
21+
reminderChannels: object;
2122
}
2223

2324
const IronMicSchema = new Schema<IUpdatableMessage>(
@@ -53,6 +54,7 @@ const DiscordConfigSchema = new Schema<IDiscordConfig>(
5354
ironMic: IronMicSchema,
5455
onlineControllers: OnlineControllersSchema,
5556
cleanupChannels: { type: Object },
57+
reminderChannels: { type: Object },
5658
},
5759
{ collection: 'config' },
5860
);

0 commit comments

Comments
 (0)