Comments (11)
Note to newcomers: things have evolved since this issue was first posted, and Telethon now makes it just as easy to write bots as it does to write scripts that control user accounts (although that could be seen further below). So yes, Telethon can be used to make bots too.
Below follow the original comments.
If I understood correctly, no. Telethon is for using Telegram as a normal client would, not for bots. You can build a bot with this and it would seem to be a normal use, but you can't control Telegram bots per se with Telethon. You can, however, manage them by talking to the @BotFather, in the same way you can do with any client.
from telethon.
By the way, if you want to build a bot, maybe Lonabot is a good start, if you're looking for something that I made. There are tons of other libraries out there.
from telethon.
I want to access full MTProto method rather than normal vanilla bot API. What I need is a bot token login method like Telegram-CLI --bot (https://github.com/vysheng/tg/wiki/Telegram-CLI-Arguments).
I believe if Telegram-CLI can do it, all MTProto lib can do it as well. I think it's just about auth staff. If you have no plan of this feature, I'll try to implement.
from telethon.
What I need is a bot token login method like Telegram-CLI --bot
But there's no bot token, is there? It's just a normal user, and it would need a phone (even if it is just a virtual one), as far as I know.
If you have no plan of this feature
I don't know if it's possible to use a bot token to access the full list of methods as a normal user would, but if you manage to succeed, I'd be glad to merge!
from telethon.
@XyLoNaMiyX if you use Telegram-CLI --bot to start it, it will ask you a bot token instead of phone number and code. Then the client works like a normal one but you are a bot. You can chat with others like normal user. But bot limitations are still there, like you can't initiate a new chat.
from telethon.
I see… Pretty cool. Maybe we could make a different class, TelegramBotClient
, which behaved just like the normal TelegramClient
but was a bot.
from telethon.
I have more questions. What are we supposed to implement for the bot? Should we parse the bot methods just like we parsed the original .tl
methods? Is this only for the interactive client, or as another client (TelegramBotClient
)? Thing is a bot works quite differently than how a normal user does. Perhaps this should be a completely separate project?
from telethon.
you dont need to implement anything other than the authorize
auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization;
then everything else works like a normal user, but some methods are disabled and others are limited. Like adding users to group etc
from telethon.
I didn't know that was a thing @JuanPotato, thanks for pointing us in the right direction!
from telethon.
Usage: client.sign_in(bot_token='your hash')
.
from telethon.
Can this works on the telegram desktop application?
from telethon.
Related Issues (20)
- Wrong Message type in MessageMethods.send_message() HOT 3
- Telegram generates non int api_id HOT 7
- Сan I change the documentation theme to furo? HOT 1
- Best practice with needing Bot in multiple places HOT 1
- unable to get all channel participants HOT 2
- Example bot from the documentation does not work HOT 3
- SendConfirmPhoneCodeRequest successful run but not code is received HOT 1
- incorrect operation of the event.MessageEdited HOT 2
- Is there a way to get accont's login email and 2fa email? HOT 2
- Memory continues to increase HOT 4
- Download speed slow even after installing cryptg HOT 2
- Missing MessagePeerReactions from recent_reactions after running iter_messages(). HOT 2
- How to set timeout between parallel requests to Telegram servers? HOT 1
- I am got Logoff on phone after closing running file HOT 1
- inject self_bot parameter in initialization or control the DIFF_LIMIT HOT 1
- send_read_acknowledge doesn't work for megagroup HOT 1
- The button and event type "KeyboardButtonRequestChat" does not exist! HOT 2
- get_participants only return part of members in megagroup HOT 2
- how to resolve an add emoji link HOT 1
- Trying to get client's channels HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telethon.