This repository has been archived by the owner on Apr 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIGDBApp.ts
53 lines (48 loc) · 2.08 KB
/
IGDBApp.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import {
IConfigurationExtend, IEnvironmentRead, 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 { IGDBCommand } from './commands/IGDBCommand';
import { IGDBGameCommand } from './commands/IGDBGameCommand';
import { IGDBGamesCommand } from './commands/IGDBGamesCommand';
import { IGDBGameSearchCommand } from './commands/IGDBGameSearchCommand';
export class IGDBApp extends App {
constructor(info: IAppInfo, logger: ILogger) {
super(info, logger);
}
protected async extendConfiguration(configuration: IConfigurationExtend, environmentRead: IEnvironmentRead): Promise<void> {
await configuration.settings.provideSetting({
id: 'igdb_name',
type: SettingType.STRING,
packageValue: 'IGDB',
required: true,
public: false,
i18nLabel: 'customize_name',
i18nDescription: 'customize_name_description',
});
await configuration.settings.provideSetting({
id: 'igdb_icon',
type: SettingType.STRING,
packageValue: 'https://github.com/tgardner851/Rocket.Chat.App-IGDB/raw/master/icon.png',
required: true,
public: false,
i18nLabel: 'customize_icon',
i18nDescription: 'customize_icon_description',
});
await configuration.settings.provideSetting({
id: 'igdb_key',
type: SettingType.STRING,
packageValue: '',
required: true,
public: false,
i18nLabel: 'customize_key',
i18nDescription: 'customize_key_description',
});
await configuration.slashCommands.provideSlashCommand(new IGDBCommand(this));
await configuration.slashCommands.provideSlashCommand(new IGDBGamesCommand(this));
await configuration.slashCommands.provideSlashCommand(new IGDBGameCommand(this));
await configuration.slashCommands.provideSlashCommand(new IGDBGameSearchCommand(this));
}
}