kartonrad/activityrole-bot

Is it possible to add a separate gamelist with approved games?

Opened this issue · 14 comments

Hi.
i want to show more games with this bot. but they are not verifeid .

Edit config.json
Set "ignoreUnverifiedActivities": false

Then the bot will add a role for every discord activity, even if the user typed it in his settings
I would advise you to set "createRoles": false
As well, so user can't create infinite roles

The bot will then only assign existing roles, whose name matches that of the game exactly
(So you need to add one for that)

Make sure the name is exactly the same as the one displayed on discord when someone plays the game

That should work, assuming that the script still runs

Yes that worked fine.
Now i have another problem.
After one day of running, the bot crashes and leaves all the roles on the players

Would you kindly provide me with the logs at the time of the crash?

Cus yeah

When the bot restarts it doesnt check the player roles to fix them

I could add that too ig

what logs do you wont? windows logs?

Idk how you're running the bot

But if you are using node . (As described in the Readme)
In a terminal

The bot will continously spit out log lines in that same terminal

If you are using docker, there is probably some sort of command to get a containers logs

Anyway, if the bot crashes, there should be an error and a stack trace
I kinda need that to understand whats going on

The bot could use an update too though, maybe that's part of the reason

Cant find any logs anywhere. running as node . the thing is i cant see when it happens, just bad luck beeing in bed or at work.
is it alot of work to do an update on the bot? btw looking in Windows Event Logs

If you're running as node .
And have opened the terminal normally

So windows menu and started the console app,
cd into the directory
Then run node .

The terminal should stay open after a crash
Stop scrolling
So it will be left exactly at the error

I don't think it's going to show up in event logs

will try it!
thx

Since i launched the bot in terminal it havent crashed once.... did it 2 days ago.
will have it open as long as it goes :)

huh
how strange
it seems like it's a wierd edge case that causes it to break

oe_dema#0 is now playing Squad (1) [Svenska Gamers]

  • role "- Squad -"
    chickenjonte#6961 is now playing Spotify (1) [SG Hosting]
    chickenjonte#6961 is now playing Spotify (1) [Svenska Gamers]
    C:\BOTS\Activityrole-bot-master\node_modules\discord.js\src\rest\RequestHandler.js:356
    throw new HTTPError(res.statusText, res.constructor.name, res.status, request);
    ^

Response: Bad Gateway
at RequestHandler.execute (C:\BOTS\Activityrole-bot-master\node_modules\discord.js\src\rest\RequestHandler.js:356:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RequestHandler.push (C:\BOTS\Activityrole-bot-master\node_modules\discord.js\src\rest\RequestHandler.js:50:14)
at async RoleManager.fetch (C:\BOTS\Activityrole-bot-master\node_modules\discord.js\src\managers\RoleManager.js:68:18)
at async pickRole (C:\BOTS\Activityrole-bot-master\index.js:139:5)
at async Client. (C:\BOTS\Activityrole-bot-master\index.js:81:24) {
code: 502,
method: 'get',
path: '/guilds/646003214323417144/roles',
requestData: { json: undefined, files: [] }
}

Node.js v20.1.0
PS C:\BOTS\Activityrole-bot-master> <

seems to be my dns server that i was going thru. since 502 is bad gateway error. will try again!

Hm i think this might be an error handling issue in my code - 502 generlly means the server was reached, but it was unavailable (disconmect/error on discords side)
My code shouldnt crash in that situation

It'll take me a while to get around to it
Because i wpuld update the library while i'm at it etc

In the meantime you might wanna run your command as a 'windows service' -
This means it starts in the background at boot and restarts on crash

I would have to look up how exactly you do that, but there is a Services manager in windows, that you use for that purpose