Added alias, name, helpCommands and loadFile (#25012)

* Added some extra defintions

- Alias and name can be used to identify the name of the bot.
- helpCommands will list all help commands
- loadFile will load a script file from a directory into the bot

* Update index.d.ts

* Making CLI happy.
This commit is contained in:
Kees C. Bakker
2018-04-24 15:57:07 -07:00
committed by Wesley Wigham
parent c8ca0b5b8f
commit e87728aa06
+5
View File
@@ -1,6 +1,7 @@
// Type definitions for hubot 2.19
// Project: https://github.com/github/hubot
// Definitions by: Dirk Gadsden <https://github.com/dirk>
// Kees C. Bakker <https://github.com/KeesCBakker>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace Hubot {
@@ -33,12 +34,16 @@ declare namespace Hubot {
type ListenerCallback<R> = (response: Response<R>) => void;
class Robot<A> {
alias: string;
brain: Brain;
name: string;
readonly adapter: A;
constructor(adapterPath: string, adapter: string, httpd: boolean, name: string, alias?: string);
hear(regex: RegExp, callback: ListenerCallback<this>): void;
hear(regex: RegExp, options: any, callback: ListenerCallback<this>): void;
helpCommands(): string[];
loadFile(directory: string, fileName: string): void;
respond(regex: RegExp, callback: ListenerCallback<this>): void;
respond(regex: RegExp, options: any, callback: ListenerCallback<this>): void;
}