Skip to content

Commit

Permalink
Add spintax syntax for images
Browse files Browse the repository at this point in the history
  • Loading branch information
ryahpalma committed Oct 3, 2020
1 parent d1c762c commit 2ca6a65
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bot.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"contains": [],
"exact": ["github"],
"response": "Git Hub Logo",
"file":"github.png"
"file":"{github.png|github-two.png}"
}
],
"blocked": [],
Expand Down
Binary file added github-two.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ WAPI.waitNewMessages(false, async (data) => {
WAPI.sendMessage2(message.chatId._serialized, response);
console.log();
if ((exactMatch || PartialMatch).file != undefined) {
window.getFile((exactMatch || PartialMatch).file).then((base64Data) => {
files = await resolveSpintax((exactMatch || PartialMatch).file);
window.getFile(files).then((base64Data) => {
//console.log(file);
WAPI.sendImage(base64Data, message.chatId._serialized, (exactMatch || PartialMatch).file);
}).catch((error) => {
Expand Down

0 comments on commit 2ca6a65

Please sign in to comment.