Compare commits

...
6 Commits
Author SHA1 Message Date
wyj 474932c05d fix: fix the error when profits are zeros 2024-11-09 09:41:16 -05:00
wyj 8ac3078ea3 fix: fix numpy version 2024-11-07 02:10:12 +08:00
wyj 89532428d5 fix: make top_count nonzero 2024-11-06 13:06:16 -05:00
wyj 0e396728c6 fix: add dependences 2024-11-02 22:15:04 +08:00
wyj c832e1da52 update: add fork info 2024-10-26 12:36:08 -04:00
wyj 221b2c8b0f set pipenv 2024-10-26 22:44:59 +08:00
12 changed files with 1595 additions and 2 deletions
+27
View File
@@ -0,0 +1,27 @@
[[source]]
url = "https://mirrors.cloud.tencent.com/pypi/simple"
verify_ssl = true
name = "pypi"
[packages]
numpy = "==1.26.4"
aiomysql = ">=0.1.1"
Brotli = ">=1.0.9"
creart = "==0.2.2"
creart-graia = "==0.1.5"
emoji = ">=2.2.0"
graia-ariadne = "==0.9.8"
graia-broadcast = "==0.19.2"
graia-saya = "==0.0.16"
jieba = ">=0.42.1"
matplotlib = "==3.7.1"
Pillow = "==9.5.0"
redis = ">=4.5.5"
scipy = ">=1.10.0"
wordcloud = ">=1.8.2.2"
[dev-packages]
ipython="*"
[requires]
python_version = "3.11"
Generated
+1548
View File
File diff suppressed because it is too large Load Diff
@@ -117,6 +117,8 @@ async def room_data(app: Ariadne, source: Source, sender: Union[Friend, Group]):
pic.draw_text("")
pic.draw_text_right(25, "Designed By StarBot", Color.GRAY)
pic.draw_text_right(25, "https://github.com/Starlwr/StarBot", Color.LINK)
pic.draw_text_right(25, "本Bot由薛定谔的大喵维护", Color.LIGHTBLUE)
pic.draw_text_right(25, "https://gitea.phywyj.dynv6.net/wyj/starbot", Color.LINK)
pic.crop_and_paste_bottom()
await app.send_message(sender, MessageChain(Image(base64=pic.base64())))
@@ -109,6 +109,8 @@ async def room_data_total(app: Ariadne, source: Source, sender: Union[Friend, Gr
pic.draw_text("")
pic.draw_text_right(25, "Designed By StarBot", Color.GRAY)
pic.draw_text_right(25, "https://github.com/Starlwr/StarBot", Color.LINK)
pic.draw_text_right(25, "本Bot由薛定谔的大喵维护", Color.LIGHTBLUE)
pic.draw_text_right(25, "https://gitea.phywyj.dynv6.net/wyj/starbot", Color.LINK)
pic.crop_and_paste_bottom()
await app.send_message(sender, MessageChain(Image(base64=pic.base64())))
@@ -170,6 +170,8 @@ async def user_data(app: Ariadne, source: Source, sender: Union[Friend, Group],
pic.draw_text("")
pic.draw_text_right(25, "Designed By StarBot", Color.GRAY)
pic.draw_text_right(25, "https://github.com/Starlwr/StarBot", Color.LINK)
pic.draw_text_right(25, "本Bot由薛定谔的大喵维护", Color.LIGHTBLUE)
pic.draw_text_right(25, "https://gitea.phywyj.dynv6.net/wyj/starbot", Color.LINK)
pic.crop_and_paste_bottom()
await app.send_message(sender, MessageChain(Image(base64=pic.base64())))
@@ -183,6 +183,8 @@ async def user_data_total(app: Ariadne, source: Source, sender: Union[Friend, Gr
pic.draw_text("")
pic.draw_text_right(25, "Designed By StarBot", Color.GRAY)
pic.draw_text_right(25, "https://github.com/Starlwr/StarBot", Color.LINK)
pic.draw_text_right(25, "本Bot由薛定谔的大喵维护", Color.LIGHTBLUE)
pic.draw_text_right(25, "https://gitea.phywyj.dynv6.net/wyj/starbot", Color.LINK)
pic.crop_and_paste_bottom()
await app.send_message(sender, MessageChain(Image(base64=pic.base64())))
+2
View File
@@ -158,6 +158,8 @@ async def _help(app: Ariadne, sender: Union[Friend, Group]):
# 底部版权信息,请务必保留此处
pic.draw_text_right(25, "Designed By StarBot", Color.GRAY)
pic.draw_text_right(25, "https://github.com/Starlwr/StarBot", Color.LINK)
pic.draw_text_right(25, "本Bot由薛定谔的大喵维护", Color.LIGHTBLUE)
pic.draw_text_right(25, "https://gitea.phywyj.dynv6.net/wyj/starbot", Color.LINK)
pic.crop_and_paste_bottom()
await app.send_message(sender, MessageChain(Image(base64=pic.base64())))
@@ -129,6 +129,8 @@ async def ranking(app: Ariadne,
pic.draw_text("")
pic.draw_text_right(25, "Designed By StarBot", Color.GRAY)
pic.draw_text_right(25, "https://github.com/Starlwr/StarBot", Color.LINK)
pic.draw_text_right(25, "本Bot由薛定谔的大喵维护", Color.LIGHTBLUE)
pic.draw_text_right(25, "https://gitea.phywyj.dynv6.net/wyj/starbot", Color.LINK)
pic.crop_and_paste_bottom()
await app.send_message(sender, MessageChain(Image(base64=pic.base64())))
@@ -124,6 +124,8 @@ async def ranking_double(app: Ariadne,
pic.draw_text("")
pic.draw_text_right(25, "Designed By StarBot", Color.GRAY)
pic.draw_text_right(25, "https://github.com/Starlwr/StarBot", Color.LINK)
pic.draw_text_right(25, "本Bot由薛定谔的大喵维护", Color.LIGHTBLUE)
pic.draw_text_right(25, "https://gitea.phywyj.dynv6.net/wyj/starbot", Color.LINK)
pic.crop_and_paste_bottom()
await app.send_message(sender, MessageChain(Image(base64=pic.base64())))
+2
View File
@@ -69,6 +69,8 @@ class DynamicPicGenerator:
pic.move_pos(0, 15)
pic.draw_text_right(25, "Designed By StarBot", Color.GRAY)
pic.draw_text_right(25, "https://github.com/Starlwr/StarBot", Color.LINK)
pic.draw_text_right(25, "本Bot由薛定谔的大喵维护", Color.LIGHTBLUE)
pic.draw_text_right(25, "https://gitea.phywyj.dynv6.net/wyj/starbot", Color.LINK)
pic.crop_and_paste_bottom()
return pic.base64()
+3 -1
View File
@@ -405,6 +405,8 @@ class LiveReportGenerator:
pic.set_row_space(10)
pic.draw_text_right(50, "Designed By StarBot", Color.GRAY, logo_limit)
pic.draw_text_right(50, "https://github.com/Starlwr/StarBot", Color.LINK, logo_limit)
pic.draw_text_right(50, "本Bot由薛定谔的大喵维护", Color.LIGHTBLUE, logo_limit)
pic.draw_text_right(50, "https://gitea.phywyj.dynv6.net/wyj/starbot", Color.LINK, logo_limit)
pic.crop_and_paste_bottom()
return pic.base64()
@@ -669,7 +671,7 @@ class LiveReportGenerator:
length = len(profits)
indexs = list(range(0, length))
abs_max = math.ceil(max(max(profits), abs(min(profits))))
abs_max = math.ceil(max(max(profits), abs(min(profits)), 0.01))
start = -abs_max - (-abs_max % 10)
end = abs_max + (-abs_max % 10)
step = int((end - start) / 10)
+1 -1
View File
@@ -153,7 +153,7 @@ class RankingGenerator:
reverse_bar_x = face_x + offset
top_bar_width = (width - face_size) / 2 + offset
if top_count is None:
top_count = max(max(counts), abs(min(counts)))
top_count = max(max(counts), abs(min(counts)), 0.001)
chart = PicGenerator(width, (face_size * count) + (row_space * (count - 1)))
chart.set_row_space(row_space)