-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/itamarshubin/shabbas-manager
- Loading branch information
Showing
5 changed files
with
69 additions
and
36 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
# whatsapp-shabbat | ||
|
||
this code looks like shit, so feal free to pr me | ||
this code looks like shit, so feel free to pr me | ||
|
||
how to use: | ||
|
||
1. go to google firebase and get yourself firebaseConfig. | ||
2. put it in the app. | ||
3. the bot is running | ||
|
||
|
||
|
||
my setup is ec2 in aws. | ||
I didn't use Docker, so if you want your project to run on linux (at least ubuntu) you need to install all the packages in the Docker file. | ||
I didn't use Docker, so if you want your project to run on linux (at least ubuntu) you need to install all the packages in the Docker file. |
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 |
---|---|---|
@@ -1,18 +1,14 @@ | ||
import fs from "fs"; | ||
import { Client } from "whatsapp-web.js"; | ||
|
||
let specialMessages:any; | ||
fs.readFile( | ||
"special-messages.json", | ||
"utf-8", | ||
(err, data) => { | ||
if (err) return null; | ||
|
||
specialMessages= JSON.parse(data); | ||
} | ||
); | ||
let specialMessages: any; | ||
fs.readFile("special-messages.json", "utf-8", (err, data) => { | ||
if (err) return null; | ||
|
||
specialMessages = JSON.parse(data); | ||
}); | ||
|
||
export const sendSpecialMessages = (from: string, client: Client) => { | ||
if (specialMessages[from]) client.sendMessage(from, specialMessages[from]); | ||
if (specialMessages && specialMessages[from]) | ||
client.sendMessage(from, specialMessages[from]); | ||
}; |
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