diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index a6f823a..cf0c91d 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -1,6 +1,9 @@ name: Github commit to telegram -on: [push] +on: + push: + branches: + - master jobs: build: @@ -25,4 +28,4 @@ jobs: # 发送通知 - name: Send notice - run: python telegram_update.py ${{ secrets.TG_BOT_TOKEN }} \ No newline at end of file + run: python telegram_update.py ${{ secrets.TG_BOT_TOKEN }} diff --git a/list.json b/list.json index 76f98af..6903ef3 100644 --- a/list.json +++ b/list.json @@ -62,7 +62,7 @@ }, { "name": "xtao-some", - "version": "1.01", + "version": "1.10", "section": "daily", "maintainer": "xtaodada", "size": "18.8 kb", diff --git a/telegram_update.py b/telegram_update.py index 9b5d37c..4a84424 100644 --- a/telegram_update.py +++ b/telegram_update.py @@ -2,8 +2,6 @@ import json, time, sys from requests import get, post token = str(sys.argv[1]) - -time.sleep(30) main = json.loads(get("https://api.github.com/repos/xtaodada/PagerMaid_Plugins/commits/master").content) push_content = {} push_content['chat_id'] = '-1001441461877' diff --git a/xtao-some.py b/xtao-some.py index e033075..f5ece22 100644 --- a/xtao-some.py +++ b/xtao-some.py @@ -14,9 +14,7 @@ from os import remove async def guess(context): reply = await context.get_reply_message() await context.edit("获取中 . . .") - if reply: - pass - else: + if not reply: context.edit("宁需要回复一句话") return True text = {'text': str(reply.message.replace("/guess ", "").replace(" ", ""))} @@ -48,7 +46,7 @@ async def admin(context): try: admins = await context.client.get_participants(chat, filter=ChannelParticipantsAdmins) except: - await context.edit('请在群组中运行。') + await context.edit('请在群组中使用。') return True admin_list = [] for admin in admins: @@ -278,11 +276,9 @@ async def pixiv(context): try: await context.edit('正在下载图片中 ...') try: - r = requests.get('https://daidr.me/imageProxy/?url=' + - pixiv_json['illust']['meta_single_page']['original_image_url']) + r = requests.get(pixiv_json['illust']['meta_single_page']['original_image_url'].replace('i.pximg.net','i.pixiv.cat')) except: - r = requests.get('https://daidr.me/imageProxy/?url=' + - pixiv_json['illust']['meta_pages'][pixiv_page - 1]['image_urls']['original']) + r = requests.get(pixiv_json['illust']['meta_pages'][pixiv_page - 1]['image_urls']['original'].replace('i.pximg.net','i.pixiv.cat')) with open("pixiv.jpg", "wb") as code: code.write(r.content) await context.edit('正在上传图片中 ...') @@ -333,11 +329,9 @@ async def pixiv(context): try: await context.edit('正在下载图片中 ...') try: - r = requests.get('https://daidr.me/imageProxy/?url=' + - pixiv_json['illust']['meta_single_page']['original_image_url']) + r = requests.get(pixiv_json['illust']['meta_single_page']['original_image_url'].replace('i.pximg.net','i.pixiv.cat')) except: - r = requests.get('https://daidr.me/imageProxy/?url=' + - pixiv_json['illust']['meta_pages'][pixiv_page - 1]['image_urls']['original']) + r = requests.get(pixiv_json['illust']['meta_pages'][pixiv_page - 1]['image_urls']['original'].replace('i.pximg.net','i.pixiv.cat')) with open("pixiv.jpg", "wb") as code: code.write(r.content) await context.edit('正在上传图片中 ...')