Unverified Commit 8ff8026b authored by Bradley Hilton's avatar Bradley Hilton
Browse files

Start work on the out of office responder app

parent 6cd6696f
import { IHttp, IMessageBuilder, IPersistence, IRead } from '@rocket.chat/apps-ts-definition/accessors';
import { App } from '@rocket.chat/apps-ts-definition/App';
import { IMessage, IPostMessageSent, IPreMessageSentModify } from '@rocket.chat/apps-ts-definition/messages';
import { RoomType } from '@rocket.chat/apps-ts-definition/rooms';
export class OutOfOfficeApp extends App implements IPostMessageSent {
public checkPostMessageSent(message: IMessage, read: IRead, http: IHttp): boolean {
// We don't auto-respond to rooms beside direct messages
// maybe in the future if the user is tagged by someone
// then they will be direct messaged but right now it is
// only direct messages
this.getLogger().log(message.room.type, RoomType.DIRECT_MESSAGE);
return message.room.type === RoomType.DIRECT_MESSAGE;
}
public executePostMessageSent(message: IMessage, read: IRead,
http: IHttp, persistence: IPersistence): void {
this.getLogger().log(message.room.type, message.sender.username, message.room.usernames);
}
}
{
"id": "09a2b0d8-94d0-433d-a53e-3961a3bb0205",
"name": "Out of Office Responder",
"nameSlug": "out-of-office",
"description": "Provides a command and auto responder for being out of office",
"version": "0.0.5",
"requiredApiVersion": ">=0.7.8",
"author": {
"name": "Bradley Hilton",
"homepage": "https://github.com/RocketChat/Rocket.Chat.Apps-dev-environment",
"support": "https://github.com/RocketChat/Rocket.Chat.Apps-dev-environment/issues"
},
"classFile": "OutOfOfficeApp.ts",
"iconFile": "out-of-office.jpg"
}
......@@ -28,32 +28,29 @@
}
},
"@rocket.chat/apps-engine": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/@rocket.chat/apps-engine/-/apps-engine-0.3.0.tgz",
"integrity": "sha512-RQ0qIqjdgAcKD+8Avi99bBfopPGwMxMLyjeeqbHAhLDnrzumwS5Cxq1YDKtTugfMWEwxokHUeLOHGfX6wax4kQ==",
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/@rocket.chat/apps-engine/-/apps-engine-0.4.0.tgz",
"integrity": "sha512-TKnBnPWBI8isse7Xxbkxy8IgKRfn8aBbF0jYKP6CiKjYC05Thq4ms7RMnANXXiIaeH49mddn1orBBq77Obj0Wg==",
"requires": {
"@rocket.chat/apps-ts-definition": "0.7.2",
"@rocket.chat/apps-ts-definition": "0.7.9",
"adm-zip": "0.4.7",
"semver": "5.4.1",
"semver": "5.5.0",
"stack-trace": "0.0.10",
"typescript": "2.4.1",
"uuid": "3.1.0"
},
"dependencies": {
"semver": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
"integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg=="
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
"integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA=="
}
}
},
"@rocket.chat/apps-ts-definition": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/@rocket.chat/apps-ts-definition/-/apps-ts-definition-0.7.2.tgz",
"integrity": "sha512-/cXSWhjDBk0CTImInxn+4dBexGsXcreOlpl2x+XBCoR6D2AbPb9Q8pxhYt8mltou957bcYJ93rgaN7u3tByxLQ==",
"requires": {
"reflect-metadata": "0.1.10"
}
"version": "0.7.9",
"resolved": "https://registry.npmjs.org/@rocket.chat/apps-ts-definition/-/apps-ts-definition-0.7.9.tgz",
"integrity": "sha512-8ZPDr5xLskcMTipKtdQB/Bs4pxMN4YKDDbzK4DnI2rX1nQhKqULuF58uIuwg+/75eQv0Zb3HkJ+ZcjKXUgH5og=="
},
"@types/body-parser": {
"version": "1.16.4",
......@@ -4704,7 +4701,8 @@
"reflect-metadata": {
"version": "0.1.10",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.10.tgz",
"integrity": "sha1-tPg3BEFqytiZiMmxVjXUfgO5NEo="
"integrity": "sha1-tPg3BEFqytiZiMmxVjXUfgO5NEo=",
"dev": true
},
"regenerator-runtime": {
"version": "0.10.5",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment