Fixed handling of non-ascii messages.
This commit is contained in:
parent
919dd9e940
commit
d67f73c3c5
@ -17,7 +17,7 @@ This is a bot that logs public Group Chats to a Postgres Database.
|
|||||||
```
|
```
|
||||||
- Create a Telegram group.
|
- Create a Telegram group.
|
||||||
- Add your bot to the group like so: https://stackoverflow.com/questions/37338101/how-to-add-a-bot-to-a-telegram-group
|
- Add your bot to the group like so: https://stackoverflow.com/questions/37338101/how-to-add-a-bot-to-a-telegram-group
|
||||||
- Your bot only sees commands. Use `/setprivacy` with `@BotFather` in order to allow it to see all messages in a group.
|
- Use `/setprivacy` with `@BotFather` in order to allow it to see all messages in a group.
|
||||||
|
|
||||||
## Running the bot
|
## Running the bot
|
||||||
|
|
||||||
|
2
bot.py
2
bot.py
@ -39,7 +39,7 @@ def logger(bot, update):
|
|||||||
else:
|
else:
|
||||||
print("Something went wrong adding the user {}".format(user.id))
|
print("Something went wrong adding the user {}".format(user.id))
|
||||||
|
|
||||||
print("{} : {}".format(user.username,update.message.text))
|
print("{} : {}".format(user.username.encode('utf-8'),update.message.text.encode('utf-8')))
|
||||||
|
|
||||||
# DB queries
|
# DB queries
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user