Skip to content

Commit

Permalink
fix: 新增版本更新提示
Browse files Browse the repository at this point in the history
  • Loading branch information
DoodleBears committed Jun 30, 2021
1 parent d97e26f commit 3a6f21b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,7 @@ log/*
.eslint.js

# macOS
.DS_Store
.DS_Store

# IDE
.vscode/
12 changes: 10 additions & 2 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import aiohttp

VERSION = 'v1.5.2'

DOODLEBEAR_VERSION = 'v1.5.2-210630'

def check_update():
asyncio.ensure_future(_do_check_update())
Expand All @@ -18,7 +18,15 @@ async def _do_check_update():
data = await r.json()
if data['name'] != VERSION:
print('---------------------------------------------')
print('New version available:', data['name'])
print('Original blivechat has a new version available:', data['name'])
print(data['body'])
print('Download:', data['html_url'])
print('---------------------------------------------')
async with session.get('https://api.github.com/repos/DoodleBears/blivechat/releases/latest') as r:
data = await r.json()
if data['name'] != DOODLEBEAR_VERSION:
print('---------------------------------------------')
print('只熊KUMA版 blivechat has a new version available:', data['name'])
print(data['body'])
print('Download:', data['html_url'])
print('---------------------------------------------')
Expand Down

0 comments on commit 3a6f21b

Please sign in to comment.