diff --git a/list.json b/list.json index da63d5d..3743f05 100644 --- a/list.json +++ b/list.json @@ -62,13 +62,13 @@ }, { "name": "xtao-some", - "version": "1.203", + "version": "1.21", "section": "daily", "maintainer": "xtaodada", - "size": "18.8 kb", + "size": "12.9 kb", "supported": true, "des-short": "一大堆便民功能。", - "des": "超多功能 例如 -ip -ipping -guess -getdel -get_bots 等。" + "des": "超多功能 例如 -ip -ipping -guess -getdel -get_bots -wiki 等。" }, { "name": "yb-dl", diff --git a/xtao-some.py b/xtao-some.py index 4a9a194..bfb12c3 100644 --- a/xtao-some.py +++ b/xtao-some.py @@ -42,7 +42,6 @@ async def guess(context): description="查询维基百科词条", parameters="<词组>") async def wiki(context): - lang = config['application_language'].replace('zh-cn', 'zh') await context.edit("获取中 . . .") try: message = await obtain_message(context) @@ -61,18 +60,8 @@ async def wiki(context): wiki_content = wiki_json['query']['search'][0]['snippet'].replace('', '**').replace( '', '**') wiki_time = wiki_json['query']['search'][0]['timestamp'].replace('T', ' ').replace('Z', ' ') - try: - await context.edit("正在生成翻译中 . . .") - USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:65.0) Gecko/20100101 Firefox/65.0" - headers = {"user-agent": USER_AGENT} - wiki_content = json.loads(requests.get("https://xtaolink.cn/git/m/t.php?lang=" + lang + '&text=' + - clear_emojis(wiki_content), headers=headers) - .content.decode("utf-8"))['data']['target_text'] - message = '词条: [' + wiki_title + '](https://zh.wikipedia.org/zh-cn/' + wiki_title + ')\n\n' + \ - wiki_content + '...\n\n此词条最后修订于 ' + wiki_time - except ValueError: - await context.edit("出错了呜呜呜 ~ 找不到目标语言,请更正配置文件中的错误。") - return + message = '词条: [' + wiki_title + '](https://zh.wikipedia.org/zh-cn/' + wiki_title + ')\n\n' + \ + wiki_content + '...\n\n此词条最后修订于 ' + wiki_time await context.edit(message) else: await context.edit("没有匹配到相关词条")