Comments (3)
Hi, you missed the await in your snippet. With it it works fine for me, showing the two buttons
from python-telegram-bot.
I have the await in my code, I forgot to await the function when I was writing an MWE. Correcting there.
from python-telegram-bot.
I can't reproduce either. MWE:
import asyncio
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Bot
async def main():
img_stream = open("tests/data/game.png", "rb")
user_id = 1145108092
buttons = [
InlineKeyboardButton(
"A",
callback_data=str(
{
"test": "test1",
}
),
),
InlineKeyboardButton(
"B",
callback_data=str(
{
"test": "test2",
}
),
),
]
mkp = InlineKeyboardMarkup([buttons])
async with Bot("TOKEN") as bot:
await bot.send_photo(
chat_id=user_id,
photo=img_stream,
reply_markup=mkp,
)
if __name__ == "__main__":
asyncio.run(main())
Closing.
from python-telegram-bot.
Related Issues (20)
- [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
- HTML tag in user's profile name makes problem in parse html HOT 3
- [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 3
- [FEATURE] API 7.4
- [FEATURE] Automate adding some of the new API features using python script
- [FEATURE] Add chat_id in ChatMemberHandler to Filter Specific Chat(s) HOT 2
- [FEATURE] Telegram types/objects entities as a standalone package HOT 10
- [FEATURE] Add `edit_photo` in `telegram._message.Message` HOT 2
- [BUG] ValueError: invalid literal for int() with base 10: '[]' HOT 8
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.