1 year ago
#74510
pyrogrammer228
(Pyrogram/Telegrm bot) Russian words are not displayed correctly in Telegram
I made a word randomizer which works with txt file of words. But the bot send messages in wrong coding and i receive "РѕР±СЂСЏРґРЅРёРє" when it should be "обрядник". How to fix that?
The code:
with open("C:\\Users\\User\\Desktop\\russian_nouns.txt") as f:
lines = f.read().splitlines()
@bot.on_message(filters.command('rng') & filters.private)
def command(bot, message):
word = random.choice(lines)
bot.send_message(message.chat.id, word)
python
utf-8
telegram
telegram-bot
pyrogram
0 Answers
Your Answer