diff --git a/app/server.py b/app/server.py index 28903798..ee345beb 100644 --- a/app/server.py +++ b/app/server.py @@ -119,8 +119,8 @@ def extract_urls_from_event(event): filetype_voice_extension_allowed = ['m4a', 'webm', 'mp3', 'wav'] max_file_size = 3 * 1024 * 1024 -limiter_message_per_user = 10 -limiter_time_period = 8 * 3600 +limiter_message_per_user = 5 +limiter_time_period = 24 * 3600 limiter = RateLimiter(limit=limiter_message_per_user, period=limiter_time_period) def dialog_context_keep_latest(dialog_texts, max_length=1): @@ -254,12 +254,12 @@ def handle_mentions(event, say, logger): thread_ts = event["ts"] if not is_active_user(user): - say(f'<@{user}>, 你的账户未激活,请添加微信 `improve365_cn` 联系管理员激活你的账户后再试用。', thread_ts=thread_ts) + say(f'<@{user}>, 你的账户未激活,请微信联系 `improve365_cn` 管理员激活你的账户后再试用。', thread_ts=thread_ts) return if not limiter.allow_request(user): if not is_premium_user(user): - say(f'<@{user}>, you have reached the limit of {limiter_message_per_user} messages {limiter_time_period / 3600} hour, please subscribe to our Premium plan to support our service. You can find the payment link by clicking on the bot and selecting the Home tab.', thread_ts=thread_ts) + say(f'<@{user}>, 免费用户试用额度为 {limiter_message_per_user} 条对话每 {limiter_time_period / 3600} 小时, 你已超出该限制,请等待后再试。如欲购买请微信联系 `improve365_cn` 管理员。', thread_ts=thread_ts) return bot_process(event, say, logger)