Skip to content

Commit

Permalink
优化提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Yudaotor committed Mar 29, 2023
1 parent 20e83e6 commit 3fa9082
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions EsportsHelper/Match.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def watchMatches(self, delay):
isDrop, imgUrl, title = self.rewards.checkNewDrops()
if isDrop:
for tit in title:
self.log.info(f"ΩДΩ 发现新的掉落: {tit}")
print(f"[blue]ΩДΩ 发现新的掉落: {tit}[/blue]")
self.log.info(f"ΩДΩ {self.config.username}发现新的掉落: {tit}")
print(f"[blue]ΩДΩ {self.config.username}发现新的掉落: {tit}[/blue]")
if self.config.connectorDropsUrl != "":
self.rewards.notifyDrops(imgUrl=imgUrl, title=title)
sleep(3)
Expand Down
6 changes: 3 additions & 3 deletions EsportsHelper/Rewards.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def notifyDrops(self, imgUrl, title):
"msgtype": "link",
"link": {
"text": "Drop掉落提醒",
"title": f"{title[i]}",
"title": f"[{self.config.username}]{title[i]}",
"picUrl": f"{imgUrl[i]}",
"messageUrl": "https://lolesports.com/rewards"
}
Expand All @@ -88,7 +88,7 @@ def notifyDrops(self, imgUrl, title):
elif "https://discord.com/api/webhooks" in self.config.connectorDropsUrl:
embed = {
"title": "掉落提醒",
"description": f"{title[i]}",
"description": f"[{self.config.username}]{title[i]}",
"image": {"url": f"{imgUrl[i]}"},
"thumbnail": {"url": "https://www.cdnjson.com/images/2023/03/26/QQ20230326153220.jpg"},
"color": 6676471,
Expand All @@ -101,7 +101,7 @@ def notifyDrops(self, imgUrl, title):
time.sleep(5)
elif "https://fwalert.com" in self.config.connectorDropsUrl:
params = {
"text": f"{title[i]}"
"text": f"[{self.config.username}]{title[i]}"
}
requests.post(self.config.connectorDropsUrl, headers={"Content-type": "application/json"}, json=params)
time.sleep(5)
Expand Down
2 changes: 1 addition & 1 deletion EsportsHelper/Twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ def setTwitchQuality(self) -> bool:
except Exception as e:
print_exc()
self.log.error(format_exc())
return False
return False

0 comments on commit 3fa9082

Please sign in to comment.