mirror of
https://github.com/Paillat-dev/FABLE.git
synced 2026-01-02 01:06:20 +00:00
fix(main.py): handle case when skip_channel_default setting is provided and is not None, by loading the specified channel instead of prompting the user for input
feat(main.py): add support for skip_channel_default setting to skip the channel selection prompt and load a specific channel automatically
This commit is contained in:
10
main.py
10
main.py
@@ -86,6 +86,16 @@ async def main():
|
||||
printm("It looks like you don't have any channels yet. Let's create one!")
|
||||
channel = Channel()
|
||||
await channel.create()
|
||||
else:
|
||||
if settings.skip_channel_default != None:
|
||||
if type(settings.skip_channel_default) == str:
|
||||
channel_name = settings.skip_channel_default
|
||||
elif type(settings.skip_channel_default) == int:
|
||||
channel_name = channels[settings.skip_channel_default]
|
||||
else:
|
||||
raise TypeError("The skip_channel_default setting must be either a string or an integer.")
|
||||
channel = Channel()
|
||||
await channel.load(channel_name)
|
||||
else:
|
||||
printm("Here are your channels:")
|
||||
for i, channel in enumerate(channels):
|
||||
|
||||
Reference in New Issue
Block a user