python-telegram-bot1 python-telegram-bot v20.0 에러 날 때 해결방법(RuntimeWarning: coroutine 'Bot.send_message' was never awaited) 기존 python-telegram-bot 에선 다음과 같이 심플하게 메세지를 보낼 수 있었다. import telegram bot = telegram.Bot(token='') chat_id = bot.send_message(chat_id=chat_id, text="보낼내용") 그런데 v20 으로 업데이트 되며 이 방법으로 메세지를 보내려고 하면 RuntimeWarning: coroutine 'Bot.send_message' was never awaited 라는 에러메세지를 뿜으며 작동되지않는다. 파이썬 asyncio 를 이용해서 간단히 해결할 수 있다. import telegram import asyncio bot = telegram.Bot(token='') chat_id = asyncio.run(bot.. 2023. 1. 12. 이전 1 다음