diff options
Diffstat (limited to 'AyaBot/plugins')
19 files changed, 61 insertions, 17 deletions
diff --git a/AyaBot/plugins/__pycache__/anime_search_in_photo.cpython-37.pyc b/AyaBot/plugins/__pycache__/anime_search_in_photo.cpython-37.pyc Binary files differindex 7018578..a606652 100644 --- a/AyaBot/plugins/__pycache__/anime_search_in_photo.cpython-37.pyc +++ b/AyaBot/plugins/__pycache__/anime_search_in_photo.cpython-37.pyc diff --git a/AyaBot/plugins/__pycache__/anime_search_photo.cpython-37.pyc b/AyaBot/plugins/__pycache__/anime_search_photo.cpython-37.pyc Binary files differnew file mode 100644 index 0000000..8eb81e7 --- /dev/null +++ b/AyaBot/plugins/__pycache__/anime_search_photo.cpython-37.pyc diff --git a/AyaBot/plugins/__pycache__/covid19.cpython-37.pyc b/AyaBot/plugins/__pycache__/covid19.cpython-37.pyc Binary files differindex be04c61..6dda69f 100644 --- a/AyaBot/plugins/__pycache__/covid19.cpython-37.pyc +++ b/AyaBot/plugins/__pycache__/covid19.cpython-37.pyc diff --git a/AyaBot/plugins/__pycache__/hbook.cpython-37.pyc b/AyaBot/plugins/__pycache__/hbook.cpython-37.pyc Binary files differindex 9d3982b..c634d3b 100644 --- a/AyaBot/plugins/__pycache__/hbook.cpython-37.pyc +++ b/AyaBot/plugins/__pycache__/hbook.cpython-37.pyc diff --git a/AyaBot/plugins/__pycache__/hitokoto.cpython-37.pyc b/AyaBot/plugins/__pycache__/hitokoto.cpython-37.pyc Binary files differindex 6bd50f8..cddfff3 100644 --- a/AyaBot/plugins/__pycache__/hitokoto.cpython-37.pyc +++ b/AyaBot/plugins/__pycache__/hitokoto.cpython-37.pyc diff --git a/AyaBot/plugins/__pycache__/other.cpython-37.pyc b/AyaBot/plugins/__pycache__/other.cpython-37.pyc Binary files differindex 0c6ddd0..1b4d258 100644 --- a/AyaBot/plugins/__pycache__/other.cpython-37.pyc +++ b/AyaBot/plugins/__pycache__/other.cpython-37.pyc diff --git a/AyaBot/plugins/__pycache__/pixiv_seach_photo.cpython-37.pyc b/AyaBot/plugins/__pycache__/pixiv_seach_photo.cpython-37.pyc Binary files differnew file mode 100644 index 0000000..d672578 --- /dev/null +++ b/AyaBot/plugins/__pycache__/pixiv_seach_photo.cpython-37.pyc diff --git a/AyaBot/plugins/__pycache__/setu.cpython-37.pyc b/AyaBot/plugins/__pycache__/setu.cpython-37.pyc Binary files differnew file mode 100644 index 0000000..19fb6b1 --- /dev/null +++ b/AyaBot/plugins/__pycache__/setu.cpython-37.pyc diff --git a/AyaBot/plugins/__pycache__/translate.cpython-37.pyc b/AyaBot/plugins/__pycache__/translate.cpython-37.pyc Binary files differindex 6346914..24b6b9a 100644 --- a/AyaBot/plugins/__pycache__/translate.cpython-37.pyc +++ b/AyaBot/plugins/__pycache__/translate.cpython-37.pyc diff --git a/AyaBot/plugins/__pycache__/weather.cpython-37.pyc b/AyaBot/plugins/__pycache__/weather.cpython-37.pyc Binary files differindex fab7f30..e9783d5 100644 --- a/AyaBot/plugins/__pycache__/weather.cpython-37.pyc +++ b/AyaBot/plugins/__pycache__/weather.cpython-37.pyc diff --git a/AyaBot/plugins/__pycache__/welcome.cpython-37.pyc b/AyaBot/plugins/__pycache__/welcome.cpython-37.pyc Binary files differnew file mode 100644 index 0000000..05e20cf --- /dev/null +++ b/AyaBot/plugins/__pycache__/welcome.cpython-37.pyc diff --git a/AyaBot/plugins/__pycache__/ytu.cpython-37.pyc b/AyaBot/plugins/__pycache__/ytu.cpython-37.pyc Binary files differnew file mode 100644 index 0000000..3bce10b --- /dev/null +++ b/AyaBot/plugins/__pycache__/ytu.cpython-37.pyc diff --git a/AyaBot/plugins/anime_search_in_photo.py b/AyaBot/plugins/anime_search_photo.py index ccafa1d..7462e9b 100644 --- a/AyaBot/plugins/anime_search_in_photo.py +++ b/AyaBot/plugins/anime_search_photo.py @@ -54,6 +54,7 @@ async def _(session: CommandSession): img = re.findall(p, msg) if img: URL = f'https://trace.moe/api/search?url={img[0]}' + print(URL) req = await get_bytes(URL) if req: data = json.loads(req.decode()) diff --git a/AyaBot/plugins/covid19.py b/AyaBot/plugins/covid19.py index 393d31b..d474ccd 100644 --- a/AyaBot/plugins/covid19.py +++ b/AyaBot/plugins/covid19.py @@ -2,7 +2,7 @@ import re import json import sys -sys.path.append(r'请改成你机器人的对应目录\Aya\AyaBot\plugins\Module') +sys.path.append('D:\\code\\Aya\\AyaBot\\plugins\\Module') import demjson import requests from pprint import pformat, pprint diff --git a/AyaBot/plugins/hbook.py b/AyaBot/plugins/hbook.py index 83d5002..29a3df5 100644 --- a/AyaBot/plugins/hbook.py +++ b/AyaBot/plugins/hbook.py @@ -13,7 +13,7 @@ async def post_bytes(url, headers=None,data=None): hbook_switch = True -@on_command('switch', aliases=['开启', '关闭'], only_to_me=False) +@on_command('hbook_switch', aliases=['开启', '关闭'], only_to_me=False) async def _(session: CommandSession): if session.ctx['user_id'] in session.bot.config.SUPERUSERS: command = session.ctx['raw_message'].split(' ', 1) diff --git a/AyaBot/plugins/other.py b/AyaBot/plugins/other.py index 0ff94cf..bec5167 100644 --- a/AyaBot/plugins/other.py +++ b/AyaBot/plugins/other.py @@ -12,19 +12,6 @@ master = bot.config.SUPERUSERS bangroup = [] #推送屏蔽群名单 - -@on_command('阿这', only_to_me=False) -async def _(session: CommandSession): - await session.send('阿这') - -@on_command('喵', aliases=['喵喵', '喵喵喵'], only_to_me=False) -async def _(session: CommandSession): - await session.send('喵~') - -@on_command('奶宝', aliases=['@๑ ^ ₃•๑', '奶够翘'], only_to_me=False) -async def _(session: CommandSession): - await session.send('别叫了别叫了,8在') - @on_command('抽签', only_to_me=False) async def _(session: CommandSession): await session.send(str(random.choice(['大凶', '小凶', '凶', '吉', '小吉', '中吉', '大吉']))) diff --git a/AyaBot/plugins/translate.py b/AyaBot/plugins/translate.py index 9f56dca..916c723 100644 --- a/AyaBot/plugins/translate.py +++ b/AyaBot/plugins/translate.py @@ -1,7 +1,7 @@ # -*- coding:utf-8 -*- import re import sys -sys.path.append(r'请改成你机器人的对应目录\Aya\AyaBot\plugins\Module') +sys.path.append('D:\\code\\Aya\\AyaBot\\plugins\\Module') import demjson import requests from pprint import pformat, pprint diff --git a/AyaBot/plugins/weather.py b/AyaBot/plugins/weather.py index 6e384b5..158cde2 100644 --- a/AyaBot/plugins/weather.py +++ b/AyaBot/plugins/weather.py @@ -2,7 +2,7 @@ import os import re import sys -sys.path.append(r'请改成你机器人的对应目录\Aya\AyaBot\plugins\Module') +sys.path.append('D:\\code\\Aya\\AyaBot\\plugins\\Module') import json import requests from nonebot import on_command, CommandSession diff --git a/AyaBot/plugins/ytu.py b/AyaBot/plugins/ytu.py new file mode 100644 index 0000000..3d396b0 --- /dev/null +++ b/AyaBot/plugins/ytu.py @@ -0,0 +1,56 @@ +import json +import random +import nonebot +import requests +from nonebot import on_command, CommandSession + +a = '1' +b = '2' +c = '3' + +hphoto_switch = True +@on_command('hphoto_switch', aliases=['开启一图', '关闭一图'], only_to_me=False) +async def _(session: CommandSession): + if session.ctx['user_id'] in session.bot.config.SUPERUSERS: + command = session.ctx['raw_message'].split(' ', 1) + switch = command[0] + global hphoto_switch + if switch == '开启涩图': + hphoto_switch = True + if switch == '关闭涩图': + hphoto_switch = False + await session.send('完成') + else: + await session.send('恁哪位?') + + +@on_command('hphoto', aliases=['一图'], only_to_me=False) +async def _(session: CommandSession): + if hphoto_switch: + r = random.choice([a, b, c]) + print(r) + if r == '1': + URL = 'https://konachan.com/post.json' + response = requests.request("GET", URL) + html = response.text + hp = json.loads(html) + re = random.randint(0,20) + pt = hp[re]["jpeg_url"] + await session.send(f'[CQ:image,file={pt}]') + if r == '2': + URL = 'https://danbooru.donmai.us/posts.json' + response = requests.request("GET", URL) + html = response.text + hp = json.loads(html) + re = random.randint(0,19) + pt = hp[re]["file_url"] + await session.send(f'[CQ:image,file={pt}]') + if r == '3': + URL = 'https://yande.re/post.json' + response = requests.request("GET", URL) + html = response.text + hp = json.loads(html) + re = random.randint(0,39) + pt = hp[re]["jpeg_url"] + await session.send(f'[CQ:image,file={pt}]') + |