chatgpt-telegram-bot
chatgpt-telegram-bot copied to clipboard
Queue for using the bot
How to add for users to wait their turn before using the bot?
There's no such functionality at the moment. Will keep this open as a request
An example is something like this:
request_queue = asyncio.Queue()
async def process_queue():
while True:
request = await request_queue.get()
await make_request(request)
request_queue.task_done()
async def make_request(request):
#Code for executing a request to the bot
...
async def add_to_queue(request):
await request_queue.put(request)
#Creating and running the asyncio event loop
loop = asyncio.get_event_loop()
loop.create_task(process_queue())
When will this problem be solved?