-
Notifications
You must be signed in to change notification settings - Fork 7
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 #15 from NivEz/feature/edit-inline-keyboard
added edit inline keyboard support
- Loading branch information
Showing
5 changed files
with
93 additions
and
3 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
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
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,31 @@ | ||
#!/usr/bin/env node | ||
|
||
const axios = require('axios'); | ||
|
||
try { | ||
require('dotenv').config(); | ||
} catch (e) { | ||
if (e.code === 'MODULE_NOT_FOUND') { | ||
console.log( | ||
'[] dotenv is not installed, trying with environment variables or command line arguments.', | ||
); | ||
} | ||
} | ||
|
||
const apiToken = process.env.API_TOKEN || process.env.npm_config_apiToken; | ||
|
||
const url = `https://api.telegram.org/bot${apiToken}/deleteWebhook`; | ||
|
||
(async () => { | ||
try { | ||
const res = await axios.post(url); | ||
console.log('[] Deleting webhook'); | ||
if (res.status === 200) { | ||
console.log('[]', res.data.description); | ||
} | ||
} catch (e) { | ||
console.log('[] Failed deleting webhook! Maybe the api token is invalid'); | ||
console.log(' ', e?.message); | ||
console.log(' ', e?.code); | ||
} | ||
})(); |
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