• Welcome to Simple Machines Community Forum. Please login or sign up.

Telegram Autopost Bot

Started by vbgamer45, April 11, 2020, 05:57:59 AM

Previous topic - Next topic

mpcgferreira

October 20, 2021, 02:32:28 PM #80 Last Edit: October 20, 2021, 03:01:50 PM by mpcgferreira
Also may help

My second Solution for the error {"ok":true,"result":[]}

Go in your Telegram Group
Add new User (Invite)
Search for "getidsbot" => @getidsbot
Message: /start@getidsbot
Now you see the ID. looks like 1068773197, which is -1001068773197 for bots (with -100 prefix)!!!
Kick the bot from the Group.
Now go to the Webbrowser an send this line (Test Message):
https://api.telegram.org/botAPITOKENNUMBER:APITOKENKEYHERE/sendmessage?chat_id=-100GROUPNUMBER&text=test [nofollow]
Edit the API Token and the Group-ID!

mpcgferreira

These code work to check if data provided on the setup are good

https://api.telegram.org/botxxxxxxxxxxxxxxxxxx/sendmessage?chat_id=xxxxxxxxx&text=test [nofollow]

Only need replace xxx for your data.

----

So if code is good and work on the test. The MOD don´t work with the correct data. The problem ???????

mpcgferreira

Quote from: vbgamer45 on October 20, 2021, 02:15:48 PMIt might user bot id. I don't remember. I just remember it was not easy to find out. I had to talk to a bot on telegram to get the chat id.

Hello,
These code work to test if data provided on config are good. Any help please.

Code: https://api.telegram.org/botxxxxxxxxxxxxxxxxxx/sendmessage?chat_id=xxxxxxxxx&text=test [nofollow]
Result: "{"ok":true,"result":{"message_id":178,"from":{"id":2070000772,"is_bot":true,"first_name":"test_forum","username":"test_forum_bot"},"chat":{"id":-1001000012027,"title":"Test Forum News","username":"test_forum","type":"supergroup"},"date":1634009020,"text":"test"}}

wylekk

Hi! The mod works fine, but is it possible to make it so that not the link was to the last message but the message itself?

mpcgferreira

Quote from: wylekk on December 15, 2021, 09:27:12 AMHi! The mod works fine, but is it possible to make it so that not the link was to the last message but the message itself?

you make the mod work. i try all and nothing.

wylekk

How to get a Telegram API bot token

Create and configure a bot

You don't need to write code to do that. In fact, you don't need to use your computer! Just go to the Telegram app on your device and follow these 4 simple steps:

Step 1. Find a bot named "@botfarther" in the telegram, it will help you in creating and managing your bot.

You cannot see attachments on this board.

Step 2. Send him a "/help" and you'll see all the possible commands your bot can manage.

You cannot see attachments on this board.

Step 3. To create a new bot, send "/newbot".

Follow the instructions he gave and create a new name for your bot. If you are creating a bot only for experimentation, then the name must be unique, you can use the namespace of your bot by putting your name in front of it in the username. By the way, his pseudonym can be anything.

Step 4. You've just created your Telegram bot. You'll see the new API token generated for it.

Copy your API token (example - 7041085203:GAEo9l21OJdXlrOIDU2KdYHm9T0urAMPkh).

You cannot see attachments on this board.

Step 5. Telegram chat ID.

Write in the search @get_id_bot and choose this bot.

You cannot see attachments on this board.

Click Start.

You cannot see attachments on this board.

Copy the chat ID.

You cannot see attachments on this board.

Advertisement: