Jump to content
  • 0

Telegram bot script


zolotov123344
 Share

Question

6 answers to this question

Recommended Posts

  • 0
bot_token = "XXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXX" -- Replace with your telegram bot token
chat_id = "-XXXXXXXX" -- Replace with the chat id of your group

message_to_send = "Hello world!"

local send_bot = gg.makeRequest('https://api.telegram.org/bot' .. bot_token .. '/sendMessage', nil,
                             'chat_id=' .. chat_id .. '&text=' .. message_to_send).content

This will send to a group, if you want it sent as a direct message let me know and I will try.

Edited by BadCase
Link to comment
Share on other sites

  • 0
2 hours ago, BadCase said:
    
 

   
                                

Это будет отправлено группе, если вы хотите, чтобы это было отправлено как личное сообщение, дайте мне знать, и я попробую.

bro this is incredible, until the last moment I thought it was impossible. I would like a message to be sent to me by a telegram bot directly in private messages

Link to comment
Share on other sites

  • 0
6 hours ago, zolotov123344 said:

bro this is incredible, until the last moment I thought it was impossible. I would like a message to be sent to me by a telegram bot directly in private messages

Use the same code as above but for chat ID you will send a private message /start to @RawDataBot and copy the chat ID in its response

Link to comment
Share on other sites

  • 0
11 hours ago, zolotov123344 said:

bro this is incredible, until the last moment I thought it was impossible. I would like a message to be sent to me by a telegram bot directly in private messages

Oh looks like you are able to use @telegram_name as chat_id as well so whatever user or group you want

 

Edit: after messing with this more it seems to be unreliable, might want to stick to integer ids 

Edited by BadCase
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.