From cda9aae8a3faf489f25a58856296a123a1da896a Mon Sep 17 00:00:00 2001 From: HibiKier <45528451+HibiKier@users.noreply.github.com> Date: Thu, 7 Jul 2022 22:02:33 +0800 Subject: [PATCH 01/10] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a6871a768..510bac596 100644 --- a/README.md +++ b/README.md @@ -243,6 +243,10 @@ __Docker 最新版本由 [Sakuracio](https://github.com/Sakuracio) 提供__ ## 更新 +### 2022/7/7 + +* 微博热搜选择单条热搜时也会检测时效性 [@pull/891](https://github.com/HibiKier/zhenxun_bot/pull/891) + ### 2022/7/4 * 修复商品未设置限购时无法购买 From f05d4ec9317df70a7e659267ad8ff473738c0a64 Mon Sep 17 00:00:00 2001 From: dingshan Date: Fri, 5 Aug 2022 15:35:45 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B5=9B=E9=A9=AC?= =?UTF-8?q?=E5=A8=98=E9=87=8D=E8=BD=BD=E5=8D=A1=E6=B1=A0=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/draw_card/handles/base_handle.py | 1 + plugins/draw_card/handles/pretty_handle.py | 25 ++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/plugins/draw_card/handles/base_handle.py b/plugins/draw_card/handles/base_handle.py index 9e019884b..526be07a7 100644 --- a/plugins/draw_card/handles/base_handle.py +++ b/plugins/draw_card/handles/base_handle.py @@ -50,6 +50,7 @@ class UpEvent(BaseModel): start_time: Optional[datetime] # 开始时间 end_time: Optional[datetime] # 结束时间 up_char: List[UpChar] # up对象 + up_name: str = "" TC = TypeVar("TC", bound="BaseData") diff --git a/plugins/draw_card/handles/pretty_handle.py b/plugins/draw_card/handles/pretty_handle.py index da56bd645..f4147d5d9 100644 --- a/plugins/draw_card/handles/pretty_handle.py +++ b/plugins/draw_card/handles/pretty_handle.py @@ -350,48 +350,52 @@ async def update_up_char(self): char_img = "" card_img = "" up_chars = [] + up_chars_name = [] up_cards = [] + up_cards_name = [] soup = BeautifulSoup(result, "lxml") heads = soup.find_all("span", {"class": "mw-headline"}) for head in heads: - if "时间" in head.text: + if "时间" in head.text or "期间" in head.text: time = head.find_next("p").text.split("\n")[0] if "~" in time: start, end = time.split("~") start_time = dateparser.parse(start) end_time = dateparser.parse(end) elif "赛马娘" in head.text: - char_img = head.find_next("a", {"class": "image"}).find("img")[ + char_img = head.find_next("center").find("img")[ "src" ] lines = str(head.find_next("p").text).split("\n") chars = [ line for line in lines - if "★" in line and "(" in line and ")" in line + if "★" in line and "【" in line and "】" in line ] for char in chars: star = char.count("★") - name = re.split(r"[()]", char)[-2].strip() + name = re.split(r"[【】]", char)[-2].strip() up_chars.append( UpChar(name=name, star=star, limited=False, zoom=70) ) + up_chars_name.append(name) elif "支援卡" in head.text: - card_img = head.find_next("a", {"class": "image"}).find("img")[ + card_img = head.find_next("center").find("img")[ "src" ] lines = str(head.find_next("p").text).split("\n") cards = [ line for line in lines - if "R" in line and "(" in line and ")" in line + if "R" in line and "【" in line and "】" in line ] for card in cards: star = 3 if "SSR" in card else 2 if "SR" in card else 1 - name = re.split(r"[()]", card)[-2].strip() + name = re.split(r"[【】]", card)[-2].strip() up_cards.append( UpChar(name=name, star=star, limited=False, zoom=70) ) + up_cards_name.append(name) if start_time and end_time: if start_time <= datetime.now() <= end_time: self.UP_CHAR = UpEvent( @@ -400,6 +404,7 @@ async def update_up_char(self): start_time=start_time, end_time=end_time, up_char=up_chars, + up_name=up_chars_name, ) self.UP_CARD = UpEvent( title=title, @@ -407,6 +412,7 @@ async def update_up_char(self): start_time=start_time, end_time=end_time, up_char=up_cards, + up_name=up_cards_name, ) self.dump_up_char() logger.info(f"成功获取{self.game_name_cn}当前up信息...当前up池: {title}") @@ -418,9 +424,10 @@ async def _reload_pool(self) -> Optional[Message]: self.load_up_char() if self.UP_CHAR and self.UP_CARD: return Message( - Message.template("重载成功!\n当前UP池子:{}{:image}{:image}").format( - self.UP_CHAR.title, + Message.template("重载成功!\n当前UP池子:{}{:image}\n当前支援卡池子:{}{:image}").format( + self.UP_CHAR.up_name, self.UP_CHAR.pool_img, + self.UP_CARD.up_name, self.UP_CARD.pool_img, ) ) From 6151dfb1619e70550b15ddd7efbf48aa3c0b8083 Mon Sep 17 00:00:00 2001 From: dingshan Date: Fri, 5 Aug 2022 15:42:53 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B5=9B=E9=A9=AC?= =?UTF-8?q?=E5=A8=98=E9=87=8D=E8=BD=BD=E5=8D=A1=E6=B1=A0=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/draw_card/handles/base_handle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/draw_card/handles/base_handle.py b/plugins/draw_card/handles/base_handle.py index 526be07a7..ddfc59afa 100644 --- a/plugins/draw_card/handles/base_handle.py +++ b/plugins/draw_card/handles/base_handle.py @@ -50,7 +50,7 @@ class UpEvent(BaseModel): start_time: Optional[datetime] # 开始时间 end_time: Optional[datetime] # 结束时间 up_char: List[UpChar] # up对象 - up_name: str = "" + up_name: str = "" # up名称 TC = TypeVar("TC", bound="BaseData") From 3c120ce6020282e437bf78bf3d2e4c199d029bb4 Mon Sep 17 00:00:00 2001 From: dingshan Date: Fri, 5 Aug 2022 15:49:21 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=87=E6=B3=A8?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/draw_card/handles/pretty_handle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/draw_card/handles/pretty_handle.py b/plugins/draw_card/handles/pretty_handle.py index f4147d5d9..4011e416c 100644 --- a/plugins/draw_card/handles/pretty_handle.py +++ b/plugins/draw_card/handles/pretty_handle.py @@ -372,7 +372,7 @@ async def update_up_char(self): for line in lines if "★" in line and "【" in line and "】" in line ] - for char in chars: + for char in set(chars): # list去重 star = char.count("★") name = re.split(r"[【】]", char)[-2].strip() up_chars.append( From ca78e32d97b6fccedd8692a7a30d910a91e9d169 Mon Sep 17 00:00:00 2001 From: HibiKier <45528451+HibiKier@users.noreply.github.com> Date: Mon, 8 Aug 2022 04:23:05 +0800 Subject: [PATCH 05/10] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index cf3fe3db8..4395ca544 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,10 @@ PS: **ARM平台** 请使用全量版 同时 **如果你的机器 RAM < 1G 可能 ## 更新 +### 2022/8/8 + +* 修复赛马娘重载卡池失败的问题 [@pull/969](https://github.com/HibiKier/zhenxun_bot/pull/969) + ### 2022/8/3 * 修复 bili动态链接在投稿视频时URL和分割线连在一起 [@pull/951](https://github.com/HibiKier/zhenxun_bot/pull/961) From ddbebba6f16c432f5dbdee27941b1d8a8a2e472c Mon Sep 17 00:00:00 2001 From: HibiKier <775757368@qq.com> Date: Sun, 14 Aug 2022 21:18:29 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8Depic=E6=9C=AA=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=97=B6=E9=97=B4=E6=97=B6=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ plugins/epic/data_source.py | 15 +++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4395ca544..359537985 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,10 @@ PS: **ARM平台** 请使用全量版 同时 **如果你的机器 RAM < 1G 可能 ## 更新 +### 2022/8/14 + +* 修复epic未获取到时间时出错 + ### 2022/8/8 * 修复赛马娘重载卡池失败的问题 [@pull/969](https://github.com/HibiKier/zhenxun_bot/pull/969) diff --git a/plugins/epic/data_source.py b/plugins/epic/data_source.py index ba4f5dd87..cbdc48c15 100755 --- a/plugins/epic/data_source.py +++ b/plugins/epic/data_source.py @@ -96,12 +96,15 @@ async def get_epic_free(bot: Bot, type_event: str): if pair["key"] == "publisherName": game_pub = pair["value"] game_desp = game["description"] - end_date_iso = game["promotions"]["promotionalOffers"][0][ - "promotionalOffers" - ][0]["endDate"][:-1] - end_date = datetime.fromisoformat(end_date_iso).strftime( - "%b.%d %H:%M" - ) + try: + end_date_iso = game["promotions"]["promotionalOffers"][0][ + "promotionalOffers" + ][0]["endDate"][:-1] + end_date = datetime.fromisoformat(end_date_iso).strftime( + "%b.%d %H:%M" + ) + except IndexError: + end_date = '未知' # API 返回不包含游戏商店 URL,此处自行拼接,可能出现少数游戏 404 请反馈 if game.get("productSlug"): game_url = "https://store.epicgames.com/zh-CN/p/{}".format( From 0b4d37a0b6dd9639214174b9c93328d3784069a8 Mon Sep 17 00:00:00 2001 From: HibiKier <775757368@qq.com> Date: Sun, 14 Aug 2022 21:31:57 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E4=B8=BB=E6=92=AD=E6=97=B6=E5=8A=A8=E6=80=81=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=9A=84id=E6=98=AF=E7=9B=B4=E6=92=AD=E9=97=B4id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + plugins/bilibili_sub/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 359537985..400a30f25 100644 --- a/README.md +++ b/README.md @@ -250,6 +250,7 @@ PS: **ARM平台** 请使用全量版 同时 **如果你的机器 RAM < 1G 可能 ### 2022/8/14 * 修复epic未获取到时间时出错 +* 修复订阅主播时动态获取的id是直播间id ### 2022/8/8 diff --git a/plugins/bilibili_sub/__init__.py b/plugins/bilibili_sub/__init__.py index 989627e32..d05b54898 100755 --- a/plugins/bilibili_sub/__init__.py +++ b/plugins/bilibili_sub/__init__.py @@ -234,7 +234,7 @@ async def _(): rst = await get_sub_status(sub.sub_id, sub.sub_type) await send_sub_msg(rst, sub, bot) if sub.sub_type == "live": - rst = await get_sub_status(sub.sub_id, "up") + rst = await get_sub_status(sub.uid, "up") await send_sub_msg(rst, sub, bot) except Exception as e: logger.error(f"B站订阅推送发生错误 sub_id:{sub.sub_id if sub else 0} {type(e)}:{e}") From 27e78c162630c4de99fb61e35761bd741037037b Mon Sep 17 00:00:00 2001 From: HibiKier <775757368@qq.com> Date: Sun, 14 Aug 2022 22:11:36 +0800 Subject: [PATCH 08/10] update README.md --- README.md | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 400a30f25..9f39d83d2 100644 --- a/README.md +++ b/README.md @@ -245,6 +245,32 @@ __Docker 全量版(包含 真寻Bot PostgreSQL数据库 go-cqhttp webui等)_ **点击上方的 GitHub 徽标查看教程** PS: **ARM平台** 请使用全量版 同时 **如果你的机器 RAM < 1G 可能无法正常启动全量版容器** +## [爱发电](https://afdian.net/@HibiKier) +
+爱发电 以及 感谢投喂 + + +### 感谢名单 +(可以告诉我你的 __github__ 地址,我偷偷换掉0v|) +[爱发电用户_b9S4](https://afdian.net/u/3d8f30581a2911edba6d52540025c377) +[爱发电用户_c58s](https://afdian.net/u/a6ad8dda195e11ed9a4152540025c377) +[爱发电用户_eNr9](https://afdian.net/u/05fdb41c0c9a11ed814952540025c377) +[MangataAkihi](https://github.com/Sakuracio) +[炀](https://afdian.net/u/69b76e9ec77b11ec874f52540025c377) +[爱发电用户_Bc6j](https://afdian.net/u/8546be24f44111eca64052540025c377) +[大魔王](https://github.com/xipesoy) +[CopilotLaLaLa](https://github.com/CopilotLaLaLa) +[嘿小欧](https://afdian.net/u/daa4bec4f24911ec82e552540025c377) +[回忆的秋千](https://afdian.net/u/e315d9c6f14f11ecbeef52540025c377) +[十年くん](https://afdian.net/@ZXYX10) +[哇](https://afdian.net/u/9b266244f23911eca19052540025c377) +[yajiwa](https://github.com/yajiwa) +[爆金币](https://afdian.net/u/0d78879ef23711ecb22452540025c377) + + +
+ + ## 更新 ### 2022/8/14 @@ -277,7 +303,7 @@ PS: **ARM平台** 请使用全量版 同时 **如果你的机器 RAM < 1G 可能 * 替换了cos和bt的url [@pull/951](https://github.com/HibiKier/zhenxun_bot/pull/951) * 发言记录统计添加日消息统计 [@pull/953](https://github.com/HibiKier/zhenxun_bot/pull/953) -### 2022/7/24 +### 2022/7/24 \[v0.1.6.2] * 订阅up动态提供直链 @@ -747,10 +773,6 @@ __..... 更多更新信息请查看文档__ ## Todo - [ ] web管理 -## 爱发电 - - - ## 感谢 [botuniverse / onebot](https://github.com/botuniverse/onebot) :超棒的机器人协议 [Mrs4s / go-cqhttp](https://github.com/Mrs4s/go-cqhttp) :cqhttp的golang实现,轻量、原生跨平台. From 51508182ef66d0343d5be0fb7e6b035c8021c9c2 Mon Sep 17 00:00:00 2001 From: shinianj <105840558+shinianj@users.noreply.github.com> Date: Tue, 16 Aug 2022 00:38:14 +0800 Subject: [PATCH 09/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f39d83d2..b07ac1c39 100644 --- a/README.md +++ b/README.md @@ -262,7 +262,7 @@ PS: **ARM平台** 请使用全量版 同时 **如果你的机器 RAM < 1G 可能 [CopilotLaLaLa](https://github.com/CopilotLaLaLa) [嘿小欧](https://afdian.net/u/daa4bec4f24911ec82e552540025c377) [回忆的秋千](https://afdian.net/u/e315d9c6f14f11ecbeef52540025c377) -[十年くん](https://afdian.net/@ZXYX10) +[十年くん](https://github.com/shinianj) [哇](https://afdian.net/u/9b266244f23911eca19052540025c377) [yajiwa](https://github.com/yajiwa) [爆金币](https://afdian.net/u/0d78879ef23711ecb22452540025c377) From 51fc4cbb6aa18b20810dccb6ea283479201cf95a Mon Sep 17 00:00:00 2001 From: zyj2134 Date: Fri, 26 Aug 2022 22:49:51 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AD=BE=E5=88=B0?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E5=8F=8C=E5=80=8D=E5=90=8E=EF=BC=8C=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=AE=B0=E5=BD=95=E8=8E=B7=E5=BE=97=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E5=8F=984=E5=80=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/sign_in/group_user_checkin.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/plugins/sign_in/group_user_checkin.py b/plugins/sign_in/group_user_checkin.py index 52ec4c6f3..87174d34a 100755 --- a/plugins/sign_in/group_user_checkin.py +++ b/plugins/sign_in/group_user_checkin.py @@ -81,19 +81,15 @@ async def _handle_check_in( await BagUser.add_gold(user_qq, group, gold) await BagUser.add_property(user_qq, group, gift) gift += ' + 1' + + logger.info( + f"(USER {user.user_qq}, GROUP {user.group_id})" + f" CHECKED IN successfully. score: {user.impression:.2f} " + f"(+{impression_added:.2f}).获取金币:{gold + gift if gift == 'gold' else gold}" + ) if critx2 + add_probability > 0.97 or critx2 < specify_probability: - logger.info( - f"(USER {user.user_qq}, GROUP {user.group_id})" - f" CHECKED IN successfully. score: {user.impression:.2f} " - f"(+{impression_added * 2:.2f}).获取金币:{gold + gift if gift == 'gold' else gold}" - ) return await get_card(user, nickname, impression_added, gold, gift, True) else: - logger.info( - f"(USER {user.user_qq}, GROUP {user.group_id})" - f" CHECKED IN successfully. score: {user.impression:.2f} " - f"(+{impression_added:.2f}).获取金币:{gold + gift if gift == 'gold' else gold}" - ) return await get_card(user, nickname, impression_added, gold, gift)