I am new to programming, so please take this into account
Traceback:
Google_translator.py", line 6, in translator
text = await g.translate(f"{text}", locale)
File "C:\Python39\lib\site-packages\async_google_trans_new\main.py", line 241, in translate
await s.close()
TypeError: object NoneType can't be used in 'await' expression
code:
**
from aiogram.types.base import String
import async_google_trans_new
async def translator(text: String, locale: String):
g = async_google_trans_new.AsyncTranslator()
text = await g.translate(f"{text}", locale)
return text
**
I use a library function call from the asynchronous code of the telegram bot, need translation.
I am new to programming, so please take this into account
Traceback: Google_translator.py", line 6, in translator text = await g.translate(f"{text}", locale) File "C:\Python39\lib\site-packages\async_google_trans_new\main.py", line 241, in translate await s.close() TypeError: object NoneType can't be used in 'await' expression
code: ** from aiogram.types.base import String import async_google_trans_new
async def translator(text: String, locale: String): g = async_google_trans_new.AsyncTranslator() text = await g.translate(f"{text}", locale) return text **
I use a library function call from the asynchronous code of the telegram bot, need translation.