Former social worker turned teacher turned self-taught coder.
Nomad remote worker in Bangkok or RV in Europe; have no idea if I'm the worst coder that ever coded, or passable. Certainly not the best.
I can follow this up until trying to get Telethon/PyTest to use my test bot instead of my live bot. I made a test both that runs on the same code as my live bot, splitting it up by having different .env files on local versus prod and having different Bot tokens in each file. But when I try to log in to the TelegramClient with my test bot token it tells me it's not valid and only accepts my live bot token.
telethon.TelegramClient is for the user account that you use to test against the bot. If you have 2 separate bots on the Production DC (data center), there is nothing to change on the Telethon side. If your test bot is on the Test DC, you need to sign in again with some Test DC-specific arguments. More details on that can be found on Telethon docs.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I can follow this up until trying to get Telethon/PyTest to use my test bot instead of my live bot. I made a test both that runs on the same code as my live bot, splitting it up by having different .env files on local versus prod and having different Bot tokens in each file. But when I try to log in to the TelegramClient with my test bot token it tells me it's not valid and only accepts my live bot token.
telethon.TelegramClient
is for the user account that you use to test against the bot. If you have 2 separate bots on the Production DC (data center), there is nothing to change on the Telethon side. If your test bot is on the Test DC, you need to sign in again with some Test DC-specific arguments. More details on that can be found on Telethon docs.