Fix weird UTF-8 error

This commit is contained in:
Nexus 2023-08-28 21:55:18 +01:00
parent e6caec11ab
commit d4cc075691
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -325,7 +325,10 @@ class Events(commands.Cog):
lines = 0
for file in root_files:
try:
code = file.read_text()
except (UnicodeDecodeError, IOError, SystemError):
continue
for line in code.splitlines():
line = line.strip()
if not line or line.startswith("#"):