Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: relocate initialize statement #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 51 additions & 51 deletions Giphy.ts
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
import {
IConfigurationExtend,
IEnvironmentRead,
ILogger,
IConfigurationExtend,
IEnvironmentRead,
} 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 { GiphyCommand } from './commands/GiphyCommand';
import { GifGetter } from './helpers/GifGetter';

export class Giphy extends App {
private gifGetter: GifGetter;
private gifGetter: GifGetter;

constructor(info: IAppInfo, logger: ILogger) {
super(info, logger);
public getGifGetter(): GifGetter {
return this.gifGetter;
}

this.gifGetter = new GifGetter();
}
public async initialize(
configuration: IConfigurationExtend,
environmentRead: IEnvironmentRead
): Promise<void> {

public getGifGetter(): GifGetter {
return this.gifGetter;
}
this.gifGetter = new GifGetter();

protected async extendConfiguration(configuration: IConfigurationExtend, environmentRead: IEnvironmentRead): Promise<void> {
await configuration.settings.provideSetting({
id: 'giphy_apikey',
type: SettingType.STRING,
packageValue: '',
required: true,
public: false,
i18nLabel: 'Customize_GIPHY_APIKey',
i18nDescription: 'Customize_GIPHY_APIKey_Description',
});
await configuration.settings.provideSetting({
id: 'giphy_lang_code',
type: SettingType.STRING,
packageValue: 'en',
required: true,
public: false,
i18nLabel: 'Customize_GIPHY_Language',
i18nDescription: 'Customize_GIPHY_Language_Description',
});
await configuration.settings.provideSetting({
id: 'giphy_rating',
type: SettingType.STRING,
packageValue: 'G',
required: true,
public: false,
i18nLabel: 'Customize_GIPHY_Rating',
i18nDescription: 'Customize_GIPHY_Rating_Description',
});
await configuration.settings.provideSetting({
id: 'giphy_show_title',
type: SettingType.BOOLEAN,
packageValue: true,
required: true,
public: false,
i18nLabel: 'Customize_GIPHY_Show_Title',
i18nDescription: 'Customize_GIPHY_Show_Title_Description',
});
await configuration.slashCommands.provideSlashCommand(new GiphyCommand(this));
}
await configuration.settings.provideSetting({
id: "giphy_apikey",
type: SettingType.STRING,
packageValue: "",
required: true,
public: false,
i18nLabel: "Customize_GIPHY_APIKey",
i18nDescription: "Customize_GIPHY_APIKey_Description",
});
await configuration.settings.provideSetting({
id: "giphy_lang_code",
type: SettingType.STRING,
packageValue: "en",
required: true,
public: false,
i18nLabel: "Customize_GIPHY_Language",
i18nDescription: "Customize_GIPHY_Language_Description",
});
await configuration.settings.provideSetting({
id: "giphy_rating",
type: SettingType.STRING,
packageValue: "G",
required: true,
public: false,
i18nLabel: "Customize_GIPHY_Rating",
i18nDescription: "Customize_GIPHY_Rating_Description",
});
await configuration.settings.provideSetting({
id: "giphy_show_title",
type: SettingType.BOOLEAN,
packageValue: true,
required: true,
public: false,
i18nLabel: "Customize_GIPHY_Show_Title",
i18nDescription: "Customize_GIPHY_Show_Title_Description",
});
await configuration.slashCommands.provideSlashCommand(
new GiphyCommand(this)
);
}
}