Skip to content

Commit

Permalink
Fix issue where special characters would get escaped
Browse files Browse the repository at this point in the history
Fix issue where special characters would get escaped
  • Loading branch information
diingus authored Jan 25, 2021
2 parents b27b13e + 88550db commit 4af0e3b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ The exported object has three key properties:
### Command parser

The command parser is configured in the `commandParserSettings` object. It contains
the message `prefix`, a map of `commands` (command name -> function).
the message `prefix`, a map of `commands` (command name -> {command: function}).

The command function receives the message object that triggered it as the first parameter.
Each whitespace-separated block is sent as a subsequent parameter. You can write `...rest`
to collect all the individual arguments into an array.

Command functions take two arguments: the message that triggered them, and an array of
arguments.
2 changes: 2 additions & 0 deletions helpers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ export const helpers = {

mp.message = turndownService.turndown( mp.message );

mp.message = mp.message.replace( /\\\\\\/gi, "" );

return mp;
},

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bitwave/chat-bot-sdk",
"version": "0.3.2",
"version": "0.3.3",
"description": "A simple chat bot sdk for [bitwave.tv]'s chat",
"main": "lib.mjs",
"scripts": {
Expand Down

0 comments on commit 4af0e3b

Please sign in to comment.