File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed
Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ import { Command } from "./interfaces/Command";
1111import { saltRepository } from "./repositories/SaltRepository" ;
1212import { config } from "./utils/config" ;
1313import { JobService } from "./services/JobService" ;
14+ import AddScheduleCommand from "./commands/AddScheduleCommand" ;
15+ import SyncScheduleCommand from "./commands/SyncScheduleCommand" ;
16+ import FetchScheduleListCommand from "./commands/FetchScheduleListCommand" ;
17+ import DeleteScheduleCommand from "./commands/DeleteScheduleCommand" ;
1418
1519export class MSGSaltBot {
1620 private slashCommandMap = new Map < string , Command > ( ) ;
@@ -45,7 +49,11 @@ export class MSGSaltBot {
4549 DMCommand ,
4650 SearchMSGMemberCommand ,
4751 CurrentSaltCommand ,
48- FilterMensionCommand
52+ FilterMensionCommand ,
53+ AddScheduleCommand ,
54+ SyncScheduleCommand ,
55+ FetchScheduleListCommand ,
56+ DeleteScheduleCommand
4957 ] ;
5058
5159 this . slashCommandMap = slashCommands . reduce ( ( map , command ) => {
@@ -75,9 +83,15 @@ export class MSGSaltBot {
7583 } catch ( error : any ) {
7684 console . error ( error ) ;
7785
78- await interaction . reply ( {
79- content : error . toString ( )
80- } ) ;
86+ if ( interaction . replied ) {
87+ await interaction . followUp ( {
88+ content : error . toString ( )
89+ } ) ;
90+ } else {
91+ await interaction . reply ( {
92+ content : error . toString ( )
93+ } ) ;
94+ }
8195 }
8296 } ) ;
8397 }
Original file line number Diff line number Diff line change @@ -3,9 +3,15 @@ import express, { Express } from "express";
33import { client } from "./discordClient" ;
44import { JobService } from "./services/JobService" ;
55import { Job } from "./interfaces/Job" ;
6+ import { ReminderSchedulerJob } from "./jobs/ReminderSchedulerJob" ;
7+ import { scheduleRepository } from "./repositories/ScheduleRepository" ;
8+ import { SchedulerJob } from "./jobs/SchedulerJob" ;
69
10+ scheduleRepository . syncRemote ( )
711
812const jobs : Job [ ] = [
13+ new ReminderSchedulerJob ( client ) ,
14+ new SchedulerJob ( client )
915] ;
1016
1117const jobService = new JobService ( jobs ) ;
You can’t perform that action at this time.
0 commit comments