Discord-S.C.U.M icon indicating copy to clipboard operation
Discord-S.C.U.M copied to clipboard

Bot disconnecting with no error messages?

Open napindc opened this issue 2 years ago • 1 comments

I have a very simple bot I've been running to track messages in a Discord channel. It runs fine 24/7 on a cloud box I have, and then it would just randomly stop with no error messages (i do have log=False). I rerun the script and then it is fine again. Does anyone know how I can improve this to not crash anymore ... or to restart after it does crash ... or help me figure out why its crashing in the first place?

And I'm running this off of https://github.com/Merubokkusu/Discord-S.C.U.M.git@262b2f1687de99ae6478240588cec29e577a6700 - the person who helped me with this bot just gave me this commit hash to use.

import discum
import os
import sys
from discord.ext import commands

bot = discum.Client(token=os.getenv('token'), log=False)

dmbot = commands.Bot(command_prefix="$")
@bot.gateway.command
def checkMessages(resp):

    if resp.event.message:
        m = resp.parsed.auto()

        // 
        // do about 40 lines of logic to the message body / attachments / replies
        // 

        // post data to a webhook
        requests.post(webhook_url, data = postObj)

napindc avatar Feb 18 '22 17:02 napindc

Hello. Did you manage to solve the problem? Faced a similar situation. Sometimes suddenly messages to the handler just stop coming

DimaDDM avatar Jan 29 '23 22:01 DimaDDM