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/modules/server/__init__.py

21 lines
662 B
Python
Raw Normal View History

2020-06-13 12:43:43 +00:00
import re
2020-08-12 16:01:34 +00:00
2020-06-13 12:43:43 +00:00
from .server import server
from .serverraw import serverraw
2020-08-12 16:01:34 +00:00
2020-06-13 12:43:43 +00:00
async def ser(str1):
2020-08-12 16:01:34 +00:00
str1 = re.sub(r'^Server', 'server', str1)
print(str1)
2020-06-13 12:43:43 +00:00
if str1.find(" -h") != -1:
2020-08-12 16:01:34 +00:00
return ('''~server <address> - 从指定地址服务器的25565端口中获取Motd。
2020-06-13 12:43:43 +00:00
~server <address>:<port> - 从指定地址服务器的端口中获取Motd
[-r] - 获取Motd的源代码''')
if str1.find(" -r") != -1:
2020-08-12 16:01:34 +00:00
str1 = re.sub(' -r', '', str1)
str1 = re.match(r'^server (.*)', str1)
2020-07-18 13:22:25 +00:00
return (await serverraw(str1.group(1)))
2020-06-13 12:43:43 +00:00
else:
2020-08-12 16:01:34 +00:00
str1 = re.match(r'^server (.*)', str1)
return (await server(str1.group(1)))