aff插件解决部分机型编码错误问题 (#84)

Co-authored-by: TNTcraftHIM <TNTcraftHIM@users.noreply.github.com>
This commit is contained in:
AAA 2020-11-30 14:47:34 +08:00 committed by GitHub
parent 7572c8aa28
commit 5ecfa90475
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

4
aff.py
View File

@ -10,7 +10,7 @@ from pagermaid.listener import listener
async def aff(context): async def aff(context):
if not context.parameter: #发送aff信息 if not context.parameter: #发送aff信息
try: try:
with open("plugins/AffExtra/aff.txt", "r") as f: with open("plugins/AffExtra/aff.txt", "r", encoding="UTF-8") as f:
msg = f.read() msg = f.read()
except: except:
msg = "" msg = ""
@ -31,7 +31,7 @@ async def aff(context):
msg = reply.message msg = reply.message
if not exists("plugins/AffExtra"): if not exists("plugins/AffExtra"):
mkdir("plugins/AffExtra") mkdir("plugins/AffExtra")
with open("plugins/AffExtra/aff.txt", "w") as f: with open("plugins/AffExtra/aff.txt", "w", encoding="UTF-8") as f:
f.write(msg) f.write(msg)
await context.edit("好耶 Aff信息保存成功。") await context.edit("好耶 Aff信息保存成功。")
sleep(3) sleep(3)

View File

@ -312,7 +312,7 @@
}, },
{ {
"name": "aff", "name": "aff",
"version": "1.1", "version": "1.2",
"section": "chat", "section": "chat",
"maintainer": "TNTcraftHIM", "maintainer": "TNTcraftHIM",
"size": "2.0 kb", "size": "2.0 kb",