Closed seshubonam closed 1 month ago
after the 10 message warning the bot stops to respond
Can you tell me how you guy implement message limit.
We implemented it using simple dict as it resets every 3 hours,it triggers the condition just doesn't send the message.
the required flow is:.
after 10 messages are sent by the ai/bot it should send a message that 10 message limit has exceeded ,
at present it doesnt send the message
and it works after set time limit (3 hours in our case) is over.
it triggers the condition just doesn't send the message.
I recommend creating a breakpoint here and then step into to see what happen in details. https://github.com/pixxels-team/matrix_chatgpt_bot/blob/93456a21c2a6e3f67b38f8b13f08c9444a297cfe/src/bot.py#L189
Besides, i guess this function will only execute once. https://github.com/pixxels-team/matrix_chatgpt_bot/blob/93456a21c2a6e3f67b38f8b13f08c9444a297cfe/src/main.py#L91-L95 https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.call_later
To make thing easier, you can use apschuduler library: https://apscheduler.readthedocs.io/en/3.x/ Create a background scheduler when matrix bot iniitialize.
will try this. thanks
took all week to solve this. but your suggestion helped 🔥 thanks. the dev also found a solution but he finally implemented yours.
Hi, we have used this matrix bot in a chat application. Where, users can use publicly available ai bot for upto 10 messages and post this, it will send a message to user about "10 message limit reached, resume in 1 hour or add your own API key"
We tried to implement this but ran into issues where the bot stopped responding after message limit is reached.
More context of our implementation: User can add own API key by using a !key command. but in our implementation, after the 10 message warning the bot stops to respond.
Any ideas how we could implement this?
thanks !