Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/command.py
2020-07-08 10:40:38 +08:00

48 lines
No EOL
1.7 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import re
import string
from blacklist import blacklist
from wikil import im
async def command(str1,member):
str1 = re.sub(r'^','~',str1)
try:
q = re.match(r'\[\[(.*)\|.*\]\]',str1)
return ('im '+q.group(1))
except Exception:
try:
q = re.match(r'^(发现新人:).*',str1)
print(q.group(1))
if str(member) == '2736881328':
return ('xrrrlei '+q.group(1))
else:
return ('paa')
except Exception:
try:
q = re.match(r'^.*(: ~)(.*)',str1)
return q.group(2)
except Exception:
try:
q = re.match(r'^~(.*)',str1)
if q.group(1).find('') != -1:
if member in blacklist():
return ('paa')
else:
return q.group(1)
else:
return q.group(1)
except Exception:
try:
q = re.match(r'^!(.*\-.*)',str1)
q = str.upper(q.group(1))
return ('bug '+q)
except Exception:
try:
w = re.findall(r'\[\[(.*?)\]\]',str1)
z = []
c = '\n'
for x in w:
print(x)
z.append(await im(x))
v = c.join(z)
return('echo '+v)
except Exception:
pass