File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ async def post_init(application: Application):
6464 BotCommand ("invite" , "🤝 邀请好友" ),
6565 BotCommand ("my" , "👤 个人积分" ),
6666 BotCommand ("top" , "🏆 积分榜单" ),
67+ BotCommand ("sign" , "🔑 查看签到口令" ),
6768 BotCommand ("fear" , "😨 恐慌指数" ),
6869 BotCommand ("help" , "💡 帮助" )
6970 ]
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ async def cmd_help(update: Update, context: ContextTypes.DEFAULT_TYPE):
6868 "📖 EchoWave 帮助手册\n \n "
6969 "🛍️ `/shop` - 积分商城 (兑换好礼)\n "
7070 "🤝 `/invite` - 生成邀请链接 (赚取积分)\n "
71+ "🔑 `/sign` - 查看本群签到口令\n "
7172 "👤 `/my` - 查看我的积分与段位\n "
7273 "🏆 `/top` - 查看本群积分富豪榜\n "
7374 "😨 `/fear` - 查看恐慌贪婪指数\n "
@@ -99,4 +100,17 @@ async def cmd_fear(update: Update, context: ContextTypes.DEFAULT_TYPE):
99100 val = data ["val" ]
100101 color = "🟢" if val > 50 else "🔴"
101102 bar = "▓" * int (val / 10 ) + "░" * (10 - int (val / 10 ))
102- await update .message .reply_text (f"{ color } 恐慌贪婪指数\n `{ bar } ` { val } \n 状态: { data ['class' ]} " , parse_mode = ParseMode .MARKDOWN )
103+ await update .message .reply_text (f"{ color } 恐慌贪婪指数\n `{ bar } ` { val } \n 状态: { data ['class' ]} " , parse_mode = ParseMode .MARKDOWN )
104+
105+ async def cmd_sign_word (update : Update , context : ContextTypes .DEFAULT_TYPE ):
106+ """查看当前群的签到口令"""
107+ chat = update .effective_chat
108+ if chat .type == 'private' :
109+ await update .message .reply_text ("⚠️ 请在群里使用此指令查看该群的签到口令。" )
110+ return
111+ group = await get_group (chat .id )
112+ if not group :
113+ await update .message .reply_text ("⚠️ 未找到本群配置,请联系管理员运行 /setup 后再试。" )
114+ return
115+ word = group ['sign_in_word' ] or "恒智牛逼"
116+ await update .message .reply_text (f"🔑 本群签到口令:`{ word } `\n 发送口令即可签到领积分。" , parse_mode = ParseMode .MARKDOWN )
Original file line number Diff line number Diff line change 1717 add_product_handler , cmd_manage_products , callback_list_products ,
1818 callback_del_product , cmd_use_code , cmd_shop , callback_buy_confirm
1919)
20+ from handlers .common import cmd_sign_word
2021
2122async def on_startup (application ):
2223 await init_db ()
@@ -35,6 +36,7 @@ async def on_startup(application):
3536 app .add_handler (CommandHandler ("help" , cmd_help ))
3637 app .add_handler (CommandHandler ("id" , cmd_id ))
3738 app .add_handler (CommandHandler ("fear" , cmd_fear ))
39+ app .add_handler (CommandHandler ("sign" , cmd_sign_word ))
3840 app .add_handler (CommandHandler ("my" , cmd_my_points ))
3941 app .add_handler (CommandHandler ("top" , cmd_top ))
4042 app .add_handler (CommandHandler ("invite" , cmd_invite ))
@@ -78,4 +80,4 @@ async def on_startup(application):
7880 app .add_handler (MessageHandler (filters .PHOTO , handle_photo_interaction ))
7981
8082 print ("🚀 EchoWave Pro Max (SQLite Edition) 已启动..." )
81- app .run_polling ()
83+ app .run_polling ()
You can’t perform that action at this time.
0 commit comments