-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Nabhag8848/feat/helper
[FEAT] added `/notion help`
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ export enum CmdParameters { | |
LOGIN = "login", | ||
LOGOUT = "logout", | ||
TEST = "test", | ||
} | ||
HELP = "help", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { | ||
IHttp, | ||
IModify, | ||
IPersistence, | ||
IRead, | ||
} from "@rocket.chat/apps-engine/definition/accessors"; | ||
import { SlashCommandContext } from "@rocket.chat/apps-engine/definition/slashcommands"; | ||
|
||
export async function helperMessage( | ||
read: IRead, | ||
http: IHttp, | ||
modify: IModify, | ||
persis: IPersistence, | ||
context: SlashCommandContext | ||
) { | ||
const helperMessage = `:wave: Need some help with \`/notion\`? | ||
Use \`/notion\` to Authorize through 🚀💬 following arguments available: | ||
\xa0\xa0• To login your Notion account \`/notion login\`. | ||
\xa0\xa0• To logout your Notion account \`/notion logout\`. | ||
\xa0\xa0• To check your status of Authorization with Notion \`/notion test\`. | ||
\xa0\xa0• To get help of Usage use \`/notion help\`. | ||
`; | ||
|
||
const messageBuilder = modify | ||
.getCreator() | ||
.startMessage() | ||
.setRoom(context.getRoom()) | ||
.setGroupable(false) | ||
.setParseUrls(false) | ||
.setText(helperMessage); | ||
|
||
await modify | ||
.getNotifier() | ||
.notifyUser(context.getSender(), messageBuilder.getMessage()); | ||
} |