Rocket.Chat删除系统斜杠命令

时间:2019-10-16 23:25:38

标签: command rocket.chat

我正在尝试删除Rocket.Chat(服务器版本v1.2.1)中的库存系统斜杠命令。 我创建了一个应用程序(Api版本1.4.0)来删除系统斜杠命令。该应用程序还在extendConfiguration(...)方法中添加了新的斜杠命令。

在App onEnable(...)方法中,我可以使用configuration.slashCommands.disableSlashCommand(...)方法进行此更改,但这不起作用。

新命令已成功添加,但我要删除的现有系统命令未删除。

例如下面的代码显示了我试图禁用系统/lennyface命令

public async onEnable(environment: IEnvironmentRead, configuration: IConfigurationModify): Promise<boolean> {

        // Remove system slash commands
        await configuration.slashCommands.disableSlashCommand('lennyface');
        ... // Others here

        return Promise.resolve(true);
    }

0 个答案:

没有答案