Handler not called


#1

Hi All,

I am trying to deploy a custom app to extend rooms - I tried several samples from https://github.com/graywolf336/RocketChatApps (even guggy one which seems to be updated for latest API version) and also from marketplace but I am not able to get any of them working. The initialization phase looks to be OK as I can see app logs but then no slash command is available nor app handler called. Server running as Docker container:

➔ ±--------------------------------------------------+
➔ | SERVER RUNNING |
➔ ±--------------------------------------------------+
➔ | |
➔ | Rocket.Chat Version: 0.71.1 |
➔ | NodeJS Version: 8.11.3 - x64 |
➔ | Platform: linux |
➔ | Process Port: 3000 |
➔ | Site URL: https://localhost |
➔ | ReplicaSet OpLog: Disabled |
➔ | Commit Hash: e73dc78ffd |
➔ | Commit Branch: HEAD |
➔ | |
➔ ±--------------------------------------------------+

Here’s code of my sample app, requiring API version 1.0.0

import {
    ILogger, IRoomExtender
} 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 { IHttp, IRead, IPersistence, IEnvironmentRead, IConfigurationModify } from '@rocket.chat/apps-   engine/definition/accessors';
import { IPreRoomCreateExtend, IRoom, RoomType } from '@rocket.chat/apps-engine/definition/rooms';

export class MyApp extends App implements IPreRoomCreateExtend  {

constructor(info: IAppInfo, logger: ILogger) {
    super(info, logger);
}

// Test out IPreRoomCreateExtend
public async checkPreRoomCreateExtend(room: IRoom, read: IRead, http: IHttp): Promise<boolean> {
    this.getLogger().info('MyApp checkPreRoomCreateExtend');
    return true;
}

// Test out IPreRoomCreateExtend
public async executePreRoomCreateExtend(room: IRoom, extend: IRoomExtender, read: IRead, http: IHttp, persistence: IPersistence): Promise<IRoom> {
    this.getLogger().info('MyApp executePreRoomCreateExtend!');

    const bot = await read.getUserReader().getById('test');

    return extend.addMember(bot).getRoom();
}

}

Any help - really appreciated

Thanks!


#2

Hi @dizzy,

Did you enable the app in admin area? All the apps installed via development mode are disabled by default and you need to enable them manually.


#3

Hi @rodrigo.nascimento,

thanks, that was it! I was reading that as Activated, probably the checkmark icon confused me

Thanks for helping out!