Comments (3)
as i got to know that i should use a new code which will enlarged the fucntionality of the User class,
https://t.me/pythontelegrambottalk/254801,
i have wrote this with details, but still it looks like , if you will not insert this in static methods in the PTB, user can face problem for those whose name contains < > , so i say to do this,
or do you guys suggest to use the on the fly generate new property, what will you suggest, pls say me by helping how i can do this also
from python-telegram-bot.
i am saying about this type of type hint, as after i defines,
user = update.message.from_user
which is a user class obj, so after this when i write user. i use dot(.) i got the available methods and property which belongs to a user class, so like this i got full_name, first_name like the, but when i add a new child class with reference to this User class, like i make the monkey 🍌🍌🍌 patching, the property i added there i dont get them in the type hint, example in the monkey patch i add full_name_html but in the type hint i dont get this, as this is not available in the real source User class, like this, how i say the new obj i will add, i want those to show in the type hint sugession in any way, though this is not necessary, i am asking if this is possible by some external codes part
see the property i added here,
see the image where i added the property in this,
from python-telegram-bot.
Thanks for reaching out and taking the time to write up this feature request.
In the future, when writing comments on GitHub threads (not only on the ptb repositories but everywher), please post code and traceback as monospaced text rather than taking screenshots. You can highlight sections of that by adding comments.
We have considered your feature request in the dev team and have decided to reject it for two reasions:
- Escaping text is a rather general use case, since inserting strings that are determined at runtime into a text message comes up in various scenarios. It doesn't just have to be the
full_name
, it could also be only the first or last name, some part of the users biography, some text that the user has entered, some text from an external source - you name it. The point is that the case were you need to escapeUser.full_name
is a rather special one and it doesn't even have to be the HTML parse mode - you could also need escaping for Markdown formatting. We don't see a need to add this very specific functionality to a general purpose library like PTB. - The convenience properties used in PTB mostly serve two purposes. Option 1: They save you from the question "Where was this attribute again?". Examples for this are
Message.chat_id
andBot.username
. Option 2: They save you from a simple but necessaryif
-clause. Examples for that areUser.full_name
orMessage.link
. However,User.full_name_html
would server neither of these purposes. Instead it would abstract away only a single rather obvious function call. We don't see a big advantage of having such a convenience property.
I will hence reject & close this feature request.
Please refrain elaborating your request any further.
from python-telegram-bot.
Related Issues (20)
- My TeamViewer ID HOT 1
- [BUG] `App.post_stop` is called even if `App.stop` is not called
- My TeamViewer ID HOT 1
- [QUESTION] HOT 5
- [BUG] Getting text_markdown_v2 from message does not always work correctly when the message contains blockquote entities HOT 5
- [BUG] `InlineKeyboardMarkup` does not appear with `send_photo()` HOT 3
- [QUESTION] Get User "Typing" behavior HOT 2
- [FEATURE] API 7.3 HOT 3
- [BUG] Can't get the first example in the documentation to work HOT 3
- Typo in documentation HOT 1
- [ERROR]"Unable to import 'Filters' from 'telegram.ext' in python-telegram-bot library" HOT 3
- Remove Functionality Deprecated by API 7.3
- [QUESTION] Having multiple CallbackQueryHandlers inside a ConversationHandler HOT 5
- [QUESTION] echobot.py is not working. HOT 4
- [FEATURE] Make has_args in CommandHandler accept str / pattern in addition to None, bool and int HOT 2
- [FEATURE] Add version deprecated information to PTB raised warnings HOT 2
- cant use proxies in telegram-python-bot [BUG] HOT 5
- [BUG] Timeout when start polling HOT 3
- CallbackQueryHandler to support filtering game_short_name 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 python-telegram-bot.