-
Notifications
You must be signed in to change notification settings - Fork 5
MWE
If you read this, you probably were asked to provide a minimal working example (MWE) in the user group or the issue tracker of the python-telgeram-bot library.
So here is what that means:
When trying to help you with a problem, it's often helpful to see your code instead of a vague description of the issue. Of course, a better description often also helps (see this article on asking good technical questions).
In order for the example to actually be helpful, it must work. This means that it:
Code that's not runnable is not very useful to see an issue - at least most times. Make sure that whoever is trying to help you only needs to plug in a bot token, run the script and send /start
to the bot for the example to run.
In particular this means that
- all necessary imports are included
- no undefined functions are called or undefined modules imported
- apart from PTB no additional dependencies need to be installed
If the provided example doesn't show the described problem, it's not much of an example.
Make sure that your example contains everything needed for the problem to show - and nothing more! Nothing delays finding a bug more than hundreds of unrelated lines of code. Your example should fit in a single short file. Reducing your problematic code to such a minimal example often times already helps to identify the actual issue.
Be sure to remove your bot token before publishing the MWE! Always send it along with a concise description of what exactly the problem is and how it can be reproduced with your MWE.
As a final note, if you were asked for an MWE in the user group, please post your code using a pastebin, e.g. https://hastebin.com or https://pastebin.com, instead of posting it as plain text in the user group.
Wiki of python-telegram-bot
© Copyright 2015-2022 – Licensed by Creative Commons
- Types of Handlers
- Advanced Filters
- Storing data
- Making your bot persistent
- Adding Defaults
- Exception Handling
- Job Queue
- Arbitrary
callback_data
- Avoiding flood limits
- Frequently requested design patterns
- Code snippets
- Performance Optimizations
- Webhooks
- Telegram Passport
- Bots built with PTB
- Automated Bot Tests