lmangani / ctzn-bot

Simple bot client for CTZN

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use "resumeSession" rather than "login" (not super important)

pfrazee opened this issue · comments

Heya! Great project.

This is a super minor point -- not really an issue -- but I figured I'd mention it.

Right now the bot authenticates using "login()" every time it creates a websocket. If the bot is able to retain any state between connections, you can actually retain the session's private token and call "resumeSession()" instead.

This is generally helpful if you want to avoid storing the credentials on disk and instead have the user input the user/pass on process start. That said, for a bot, you might run into a case where the session expires between connects and there's no active operating user to create a new login session.

At any rate, I noticed this because I added metric-event logging and saw a bunch of logins from the bot. No need to change the code; just wanted to share the knowledge about the ctzn api.