Make Telegram optional#501
Conversation
dkolas
left a comment
There was a problem hiding this comment.
I definitely see value in being able to update the bot token and/or reconnect the instance to Telegram. What's the use case you're thinking of for not having to provide one at init time?
Also- I think maybe this change won't work the way it's currently written. The __init__ method allows using bot_token from the KV store if config.bot_token is None, but config.bot_token CAN'T be none, as all config fields must be filled out.
@dkolas Oh. You we're on holidays I think when I showed a demo. Should have included that in the description. Use case is:
|
@dkolas The or-statement also catches the empty string which is our default "empty" value. |
| from steamship.utils.kv_store import KeyValueStore | ||
|
|
||
|
|
||
| class TelegramTransportConfig(Config): |
There was a problem hiding this comment.
Would we want to provide a default '' string here for safety, simulate that it's now optional?
|
With apologies for slowing down the PR -- might be good to include a test in here since the Telegram code already has great test coverage. It'd probably be akin to just repeating the existing tests, but:
@dkolas the convo was both that from a development perspective (it's easier to just test things w/o telegram involved) and a user perspective (why not add every transport and then let my [bot creator's] users pick which transport they want) it's nice to support late binding |
This PR makes the bot_token optional when using the TelegramMixin.
connect_telegramroute