diff --git a/.gitignore b/.gitignore index e634f1d..dce0c1f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,8 @@ config.toml .vs .vscode -.idea \ No newline at end of file +<<<<<<< HEAD +.idea +======= +__pycache__ +>>>>>>> 51011ec401ee07fe7446b24fad680a629e12ff56 diff --git a/module/hitokoto/__init__.py b/module/hitokoto/__init__.py index 69316d5..6118d00 100644 --- a/module/hitokoto/__init__.py +++ b/module/hitokoto/__init__.py @@ -3,6 +3,9 @@ import random def hitokoto(ctypet): + + result_type = None + try: if ctypet == '动画' or ctypet == 'a': @@ -16,6 +19,7 @@ def hitokoto(ctypet): elif ctypet == '原创' or ctypet == 'e': ctype = 'e' elif ctypet == '网络' or ctypet == 'f': + elif ctypet == '来自网络' or ctypet == 'f': ctype = 'f' elif ctypet == '其他' or ctypet == 'g': ctype = 'g' @@ -38,6 +42,12 @@ def hitokoto(ctypet): return 0, hitokoto.json() else: return 3, None + elif ctypet == None: + ctype = random.choice('abcdefghijkl') + elif ctypet == 'help': + return 1, None, result_type + else: + return 3, None, result_type params_value = {'c': ctype} hitokoto = requests.get('https://v1.hitokoto.cn', params=params_value) @@ -47,6 +57,38 @@ def hitokoto(ctypet): except IOError: return 2, None + htype=hitokoto.json()['type'] + if htype=='a': + result_type = '动画' + elif htype=='b': + result_type = '动漫' + elif htype=='c': + result_type = '游戏' + elif htype=='d': + result_type = '文学' + elif htype=='e': + result_type = '原创' + elif htype=='f': + result_type = '来自网络' + elif htype=='g': + result_type = '其他' + elif htype=='h': + result_type = '影视' + elif htype=='i': + result_type = '诗词' + elif htype=='j': + result_type = '网易云' + elif htype=='k': + result_type = '哲学' + elif htype=='l': + result_type = '抖机灵' + else: + result_type = '无法获取' + + return 0, hitokoto.json(), result_type + + except IOError: + return 2, None, result_type diff --git a/module/minecraft_server/__init__.py b/module/minecraft_server/__init__.py index e69de29..b0ed445 100644 --- a/module/minecraft_server/__init__.py +++ b/module/minecraft_server/__init__.py @@ -0,0 +1,15 @@ +import time +import random +import asyncio +import traceback + +from typing import Dict, List, Tuple, Any, Optional, Union, Literal + +import qtoml +import socketio +from colorama import Fore, Style +from nacl.signing import SigningKey +from lib_not_dr.types import Options +from mcstatus import JavaServer + +def mcstatus(): diff --git a/requirement.txt b/requirement.txt index b861617..2a79a74 100644 --- a/requirement.txt +++ b/requirement.txt @@ -3,4 +3,9 @@ colorama qtoml pynacl python-socketio[asyncio_client] -mcstatus \ No newline at end of file +<<<<<<< HEAD +mcstatus +======= +mcstatus +requests +>>>>>>> 51011ec401ee07fe7446b24fad680a629e12ff56