ikabot icon indicating copy to clipboard operation
ikabot copied to clipboard

Telegram token

Open Kiskadee-dev opened this issue 1 year ago • 5 comments

Bug explanation

Currenlty the telegram token is saved with the session, the result is a frequent 'insert the telegram token' message as the session expires for any reason

would be great if the tokens could be inputted with env vars or config files to avoid this as an optional configuration

Operating System

win 10

Ikabot installation

I downloaded the pre-built Windows binary

Ikabot version

latest

Python version

No response

Kiskadee-dev avatar May 11 '23 19:05 Kiskadee-dev

The token is not saved with the session it's saved inside the .ikabot file and is encrypted with the users email / pass combo. This makes it unique for every lobby account. The way to solve the frequent "insert the telegram token" message is to insert the telegram token, or ignore the message.

Ikabot doesn't use any configuration files that are usually accessible by the user.

If you want, you can make ikabot use some environment variable as the telegram bot token, I think that could be interesting, but if you open a pull request, please make sure it doesn't override the usual configuration of the token and it doesn't break ikabot for users who do not have the environment variable set.

ikagod avatar May 12 '23 09:05 ikagod

Since a perfectly valid token can turn invalid due to a mishap somewhere, i doesn't think ignoring the message is ok as there won't be reports later. should investigate why the token is vanishing from the .ikabot file then, as the token and chat id can't turn invalid unless something messes with it later.

Yea, the idea would be to detect some optional env var or config file, the goal is to set the token once and never again.

Kiskadee-dev avatar May 12 '23 18:05 Kiskadee-dev

I have been using ikabot for a very long time and I have literally never run into an issue with the telegram token invalidating itself or vanishing in any way. If this is happening then you might want to figure out why your OS is nuking the .ikabot file, because that is literally the only way I can think of that this can happen. Ikabot is already set up in such a way as to have the telegram token set only once and never again.

ikagod avatar May 13 '23 07:05 ikagod

There are reports of other users and i've reproduced it on linux aswell

https://discord.com/channels/715980456780234823/715980456780234826/1003495467943993434

Kiskadee-dev avatar May 13 '23 22:05 Kiskadee-dev

The most likely cause of this is the deletion of the stored session data due to the user typing in the wrong password. If #131 doesn't solve this issue please feel free to reopen it.

ikagod avatar May 17 '23 11:05 ikagod

Is the issue solved?

ElieTaillard avatar May 28 '24 03:05 ElieTaillard

Didn't seen any more mentions of this issue on discord

Kiskadee-dev avatar Jun 01 '24 13:06 Kiskadee-dev