Answer the question
In order to leave comments, you need to log in
How to bring telegram bot and json id to work?
Firstly, I found out the id of the picture in the @ShowJsonBot bot - I just sent him a picture
. He answered me:
import random
import asyncio
import logging
from aiogram import Bot, types
from aiogram.utils import executor
from aiogram.utils.emoji import emojize
from aiogram.dispatcher import Dispatcher
from aiogram.types.message import ContentType
from aiogram.utils.markdown import text, bold, italic, code, pre
from aiogram.types import ParseMode, InputMediaPhoto, InputMediaVideo, ChatActions
from config import *
logging.basicConfig(format=u'%(filename)s [ LINE:%(lineno)+3s ]#%(levelname)+8s [%(asctime)s] %(message)s',
level=logging.INFO)
bot = Bot(token=TOKEN)
dp = Dispatcher(bot)
@dp.message_handler(commands=['test'])
async def process_photo_command(msg: types.Message):
await bot.send_photo(msg.from_user.id, 'AQADJzN6kS4AAwEiAwAB', reply_to_message_id=msg.message_id )
if __name__ == '__main__':
executor.start_polling(dp)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question