-
-
Save steevehook/adc828cf207182b1948eec6aa0730916 to your computer and use it in GitHub Desktop.
Revisions
-
dideler revised this gist
Apr 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ ``` b. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. The bot may need temporary message access: `@BotFather > Bot Settings > Group Privacy > Turn off` 4. Send a message using the HTTP API: https://core.telegram.org/bots/api#sendmessage ```shell curl -X POST \ -H 'Content-Type: application/json' \ -
dideler revised this gist
Apr 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ 1. [Create a bot](https://core.telegram.org/bots#6-botfather) 2. Get the bot's API token from [@BotFather](https://telegram.me/BotFather) 3. Add your bot to the chat you'll be sending messages to 3. Get the ID of the chat a. Fetch bot updates and look for the chat id: -
dideler revised this gist
Apr 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ 1. [Create a bot](https://core.telegram.org/bots#6-botfather) 2. Get the bot's API token via [@BotFather](https://telegram.me/BotFather) 3. Add your bot to the chat you'll be sending messages to 3. Get the ID of the chat a. Fetch bot updates and look for the chat id: -
dideler revised this gist
Apr 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ 1. [Create a bot](https://core.telegram.org/bots#6-botfather) 2. Gets its API token (via [@BotFather](https://telegram.me/BotFather)) 3. Add your bot to the chat you'll be sending messages to 3. Get the ID of the chat a. Fetch bot updates and look for the chat id: ``` curl https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates | jq .message.chat.id -
dideler revised this gist
Apr 20, 2020 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,12 @@ 1. [Create a bot](https://core.telegram.org/bots#6-botfather) 2. Gets its API token (via [@BotFather](https://telegram.me/BotFather)) 3. Add your bot to the chat you'll be sending messages to 3. Get the ID of the chat a. Fetch bot updates and look for the chat id: ``` curl https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates | jq .message.chat.id ``` b. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. The bot may need temporary message access: `@BotFather > Bot Settings > Group Privacy > Turn off` 4. Send a message via their HTTP API: https://core.telegram.org/bots/api#sendmessage ```shell -
dideler revised this gist
Apr 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ 1. [Create a bot](https://core.telegram.org/bots#6-botfather) 2. Gets its API token (via [@BotFather](https://telegram.me/BotFather)) 3. Get the ID of the chat 1. Add your bot to the chat 2. Fetch bot updates and look for the chat id: -
dideler revised this gist
Apr 20, 2020 . No changes.There are no files selected for viewing
-
dideler revised this gist
Jun 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ 1. Add your bot to the chat 2. Fetch bot updates and look for the chat id: ``` curl https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates | jq .message.chat.id ``` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. The bot may need temporary message access: `@BotFather > Bot Settings > Group Privacy > Turn off` -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,9 @@ 3. Get the ID of the chat 1. Add your bot to the chat 2. Fetch bot updates and look for the chat id: ``` curl https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates ``` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. The bot may need temporary message access: `@BotFather > Bot Settings > Group Privacy > Turn off` 4. Send a message via their HTTP API: https://core.telegram.org/bots/api#sendmessage -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,8 @@ 2. Gets its API token (via @BotFather) 3. Get the ID of the chat 1. Add your bot to the chat 2. Fetch bot updates and look for the chat id: `curl https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. The bot may need temporary message access: `@BotFather > Bot Settings > Group Privacy > Turn off` 4. Send a message via their HTTP API: https://core.telegram.org/bots/api#sendmessage -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ 2. Gets its API token (via @BotFather) 3. Get the ID of the chat 1. Add your bot to the chat 2. Fetch bot updates and look for the chat id: `curl https://api.telegram.org/bot$$TELEGRAM_BOT_TOKEN/getUpdates` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. The bot may need temporary message access: `@BotFather > Bot Settings > Group Privacy > Turn off` 4. Send a message via their HTTP API: https://core.telegram.org/bots/api#sendmessage -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ 2. Fetch bot updates and look for the chat id: `curl https://api.telegram.org/bot<bot_api_token>/getUpdates` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. The bot may need temporary message access: `@BotFather > Bot Settings > Group Privacy > Turn off` 4. Send a message via their HTTP API: https://core.telegram.org/bots/api#sendmessage ```shell curl -X POST \ -H 'Content-Type: application/json' \ -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ 2. Fetch bot updates and look for the chat id: `curl https://api.telegram.org/bot<bot_api_token>/getUpdates` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. The bot may need temporary message access: `@BotFather > Bot Settings > Group Privacy > Turn off` 4. Send a POST request via their HTTP API: https://core.telegram.org/bots/api#sendmessage ```shell curl -X POST \ -H 'Content-Type: application/json' \ -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 6 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,11 +5,10 @@ 2. Fetch bot updates and look for the chat id: `curl https://api.telegram.org/bot<bot_api_token>/getUpdates` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. The bot may need temporary message access: `@BotFather > Bot Settings > Group Privacy > Turn off` 4. Send a POST request via their HTTP API https://core.telegram.org/bots/api#sendmessage ```shell curl -X POST \ -H 'Content-Type: application/json' \ -d '{"chat_id": "123456789", "text": "This is a test from curl", "disable_notification": true}' \ https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage ``` -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ 1. Add your bot to the chat 2. Fetch bot updates and look for the chat id: `curl https://api.telegram.org/bot<bot_api_token>/getUpdates` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. The bot may need temporary message access: `@BotFather > Bot Settings > Group Privacy > Turn off` 4. Send a POST request via their HTTP API ```shell $ curl -X POST \ -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ 1. Add your bot to the chat 2. Fetch bot updates and look for the chat id: `curl https://api.telegram.org/bot<bot_api_token>/getUpdates` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. For groups, the bot needs temporary message access: `@BotFather > Bot Settings > Group Privacy > Turn off` 4. Send a POST request via their HTTP API ```shell $ curl -X POST \ -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ 1. Add your bot to the chat 2. Fetch bot updates and look for the chat id: `curl https://api.telegram.org/bot<bot_api_token>/getUpdates` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. For groups, the bot needs temporary access to messages: `@BotFather > Bot Settings > Group Privacy > Turn off` 4. Send a POST request via their HTTP API ```shell $ curl -X POST \ -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ 1. Add your bot to the chat 2. Fetch bot updates and look for the chat id: `curl https://api.telegram.org/bot<bot_api_token>/getUpdates` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. For group chat, the bot needs temporary access to messages: `@BotFather > Bot Settings > Group Privacy > Turn off` 4. Send a POST request via their HTTP API ```shell $ curl -X POST \ -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ 1. Add your bot to the chat 2. Fetch bot updates and look for the chat id: `curl https://api.telegram.org/bot<bot_api_token>/getUpdates` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. For group chat, the bot needs temporary access to messages: @BotFather > Bot Settings > Group Privacy > Turn off 4. Send a POST request via their HTTP API ```shell $ curl -X POST \ -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,8 @@ 3. Get the ID of the chat 1. Add your bot to the chat 2. Fetch bot updates and look for the chat id: `curl https://api.telegram.org/bot<bot_api_token>/getUpdates` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat. The chat id will appear in `bot.rb`'s output. For group chat, the bot will need temporary access to messages: @BotFather > Bot Settings > Group Privacy > Turn off 4. Send a POST request via their HTTP API ```shell $ curl -X POST \ -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 1 addition and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,10 +3,7 @@ 3. Get the ID of the chat 1. Add your bot to the chat 2. Fetch bot updates and look for the chat id: `curl https://api.telegram.org/bot<bot_api_token>/getUpdates` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) and @-mention your bot in the chat that you want the id for. The chat id will appear in `bot.rb`'s output. For group chat, the bot will need temporary access to messages: @BotFather > Bot Settings > Group Privacy > Turn off 4. Send a POST request via their HTTP API ```shell $ curl -X POST \ -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -14,4 +14,4 @@ -d '{"chat_id": "123456789", "text": "This is a test from curl", "disable_notification": true}' \ https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage ``` - Docs for sending a message: https://core.telegram.org/bots/api#sendmessage -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,10 +8,10 @@ For a write-only bot (i.e. does not respond to commands), re-enable group privacy after getting the chat id 5. Ping your bot in the chat that you want the id for 4. Send a POST request via their HTTP API ```shell $ curl -X POST \ -H 'Content-Type: application/json' \ -d '{"chat_id": "123456789", "text": "This is a test from curl", "disable_notification": true}' \ https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage ``` - Docs for sending a message: https://core.telegram.org/bots/api#sendmessage -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 5 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,12 @@ 1. [Create a bot](https://core.telegram.org/bots#6-botfather) 2. Gets its API token (via @BotFather) 3. Get the ID of the chat 1. Add your bot to the chat 2. Fetch bot updates and look for the chat id: `curl https://api.telegram.org/bot<bot_api_token>/getUpdates` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) 4. For group chat, ensure bot has access to messages: @BotFather > Bot Settings > Group Privacy > Turn off For a write-only bot (i.e. does not respond to commands), re-enable group privacy after getting the chat id 5. Ping your bot in the chat that you want the id for 4. Send a POST request via their HTTP API ```shell $ curl -X POST \ -
dideler revised this gist
Jun 16, 2019 . 1 changed file with 15 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,18 @@ 1. [Create a bot](https://core.telegram.org/bots#6-botfather) 2. Gets its API token (via @BotFather) 3. Get the ID of the chat 1. Add your bot to the chat 2. Fetch bot updates and look for the chat id: `curl https://api.telegram.org/bot<bot_api_token>/getUpdates` 3. OR, run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) 4. For group chat, ensure bot has access to messages: @BotFather > Bot Settings > Group Privacy > Turn off For a write-only bot (i.e. does not respond to commands), re-enable group privacy after getting the chat id 5. Ping your bot in the chat that you want the id for 4. Send a POST request via their HTTP API ```shell $ curl -X POST \ -H 'Content-Type: application/json' \ -d '{"chat_id": "123456789", "text": "This is a test from curl", "disable_notification": true}' \ https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage ``` - Docs for sending a message: https://core.telegram.org/bots/api#sendmessage -
dideler revised this gist
Feb 12, 2019 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,8 @@ 2. Gets its API token (via @BotFather) 3. Get the ID of the channel 1. Run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) 2. If it's a group chat, ensure bot has access to messages: @BotFather > Bot Settings > Group Privacy > Turn off If your bot is write-only (i.e. does not respond to commands), re-enable group privacy after getting the chat id 3. Ping your bot in the chat that you want the id for API Docs for sending a message: https://core.telegram.org/bots/api#sendmessage -
dideler revised this gist
Feb 12, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,8 @@ 2. Gets its API token (via @BotFather) 3. Get the ID of the channel 1. Run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) 2. If it's a group chat, ensure bot has access to messages: @BotFather Bot Settings >> Group Privacy >> Turn off 3. Ping your bot in the chat that you want the id for API Docs for sending a message: https://core.telegram.org/bots/api#sendmessage ```shell -
dideler revised this gist
Feb 12, 2019 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -11,11 +11,12 @@ # Send a message to the bot to get the current chat's ID in the console output. # If it's a group chat, invite them to the chat first. require 'logger' require 'telegram_bot' TELEGRAM_BOT_TOKEN = "YOUR_BOT_API_TOKEN" bot = TelegramBot.new(token: TELEGRAM_BOT_TOKEN, logger: Logger.new(STDOUT)) bot.get_updates(fail_silently: true) do |message| puts "@#{message.from.username}: #{message.text}" -
dideler revised this gist
Feb 12, 2019 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ 1. [Create a bot](https://core.telegram.org/bots#6-botfather) 2. Gets its API token (via @BotFather) 3. Get the ID of the channel 1. Run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) 2. Ping your bot in the chat that you want the id for 3. If it's a group chat, ensure bot has access to messages: @BotFather Bot Settings >> Group Privacy >> Turn off API Docs for sending a message: https://core.telegram.org/bots/api#sendmessage ```shell -
dideler revised this gist
Feb 12, 2019 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ 1. [Create a bot](https://core.telegram.org/bots#6-botfather) 2. Gets its API token (via @BotFather) 3. Get the ID of the channel 1. Run [bot.rb](https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1#file-bot-rb) 2. Ping your bot in the chat that you want the id for 3. If it's a group chat, ensure bot has access to messages: @BotFather Bot Settings >> Group Privacy >> Turn off API Docs for sending a message: https://core.telegram.org/bots/api#sendmessage ```shell
NewerOlder