-
Notifications
You must be signed in to change notification settings - Fork 4
/
RemindApp.ts
37 lines (33 loc) · 1.59 KB
/
RemindApp.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import {IAppAccessors, IConfigurationExtend, ILogger} from '@rocket.chat/apps-engine/definition/accessors';
import {App} from '@rocket.chat/apps-engine/definition/App';
import {IAppInfo} from '@rocket.chat/apps-engine/definition/metadata';
import {SettingType} from '@rocket.chat/apps-engine/definition/settings';
import {RemindCommand} from './src/Command/RemindCommand';
import {ScheduleProcessor} from './src/Processor/ScheduleProcessor';
export class RemindApp extends App {
constructor(info: IAppInfo, logger: ILogger, accessors: IAppAccessors) {
super(info, logger, accessors);
}
public async initialize(configuration: IConfigurationExtend): Promise<void> {
await configuration.slashCommands.provideSlashCommand(new RemindCommand(this));
await configuration.scheduler.registerProcessors([new ScheduleProcessor('remind-app')]);
await configuration.settings.provideSetting({
id : 'post-as',
i18nLabel: 'Post as',
i18nDescription: 'Choose the username that this integration will post as.\nThe user must already exist.',
required: true,
type: SettingType.STRING,
public: false,
packageValue: 'rocket.cat',
});
await configuration.settings.provideSetting({
id : 'alias',
i18nLabel: 'Alias (optional)',
i18nDescription: 'Choose the alias that will appear before the username in messages.',
required: false,
type: SettingType.STRING,
public: false,
packageValue: undefined,
});
}
}