Pārlūkot izejas kodu

Wrap stdout in default system encoding, v0.13.1

master
Zac Herd pirms 8 gadiem
vecāks
revīzija
516fe5e478
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. +5
    -1
      bot.py

+ 5
- 1
bot.py Parādīt failu

@@ -9,6 +9,8 @@
import discord
import asyncio
import os
import io
import sys
import time
import datetime
import random
@@ -27,7 +29,7 @@ from secret import token
name = "Maki"

# bot version
version = "v0.13.0"
version = "v0.13.1"

# text shown by .help command
helptext = """I am a bot written in Python by MrDetonia
@@ -347,6 +349,8 @@ def on_message(message):
else:
print('ERROR: Failed to send message to discord after 5 attempts')

# Setup stdout encoding
sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding=sys.stdout.encoding, errors="backslashreplace", line_buffering=True)

# Run the client
client.run(token)


Notiek ielāde…
Atcelt
Saglabāt