Deftera186 / cleverbotfreeapi

Simple unofficial package to interact with the same API that the Cleverbot website uses for free. This package is inspired from the package that was written in node.js: https://www.npmjs.com/package/cleverbot-free
MIT License
10 stars 2 forks source link

cleverbot() sometimes returns "<html" #5

Open Quarlie opened 2 years ago

Quarlie commented 2 years ago

Sometimes calling cleverbot() only returns "<html"

Expected Results: A Response

Actual Results: <html (string)

Code:

import cleverbotfreeapi

# Code

cleverbotfreeapi.cleverbot(message.content, session=message.author.id)

(Using the discord.py module, message.content being a string of the user's input and message.author.id being the int id of the user)

GuardianDead commented 1 year ago

This is due to the fact that sometimes with large numbers of requests from one ip address, the site sends a 403 error from html documents in the form of an error for too many requests.

Unfortunately, this is not taken into account in this repository, so you should add proxies to each subsequent request in the form of a separate conversation.