mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
new: bot sending graphs
This commit is contained in:
parent
1be487843b
commit
6393dc1ea5
2 changed files with 41 additions and 20 deletions
|
@ -1,4 +1,6 @@
|
|||
function sendMessage(message) {
|
||||
log(message);
|
||||
|
||||
var url = 'https://api.telegram.org/bot' + telegramToken +
|
||||
'/sendMessage?chat_id=' + telegramChatId +
|
||||
'&text=' + http.Encode(message);
|
||||
|
@ -7,4 +9,10 @@ function sendMessage(message) {
|
|||
if( resp.Error ) {
|
||||
log("error while running sending telegram message: " + resp.Error.Error());
|
||||
}
|
||||
}
|
||||
|
||||
function sendPhoto(path) {
|
||||
var url = 'https://api.telegram.org/bot' + telegramToken + '/sendPhoto';
|
||||
var cmd = 'curl -s -X POST "' + url + '" -F chat_id=' + telegramChatId + ' -F photo="@' + path + '"';
|
||||
run("!"+cmd);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue