zingmars / discord-bot

Simple Discord bot written in PHP that uses DiscordPHP in the background. Has some useful plugins migrated from older IRC bots. Licensed under the Beerware license.
Other
1 stars 1 forks source link

Cleverbot module dies after not being invoked after a while #3

Open zingmars opened 3 years ago

zingmars commented 3 years ago

Not sure what the time period is, but if the cleverbot module isn't used for a while the bot will freeze when it's called again. All other commands seem to work fine until this happens.

The bot should either restart the cleverbot javascript at regular intervals (preserving the history?) or somehow detect that the script is stuck and restart it if it is.

zingmars commented 3 years ago

This issue seems to happen all the time now. There was probably a change to cleverbot. Seems like the connection is timing out which is causing the hang-up. The timeout should not block the entire bot however.

The request to cleverbot should be timed out after a while.