I'm creating a chat bot for twitch, more importantly, I'm attempting to have a list that can be added to during iteration and can also be accessed to from within the channel chat. This is the overall code:
https://pastebin.com/maCbceaB
I'm focused on this portion of the code however:
clist = ["!add", ]
if message.strip() == "!add":
chat(s, "Syntax: !add !<command> <what the command does>")
if message.strip().startswith("!add"):
clist.append(message[5:])
chat(s, "The command has been added!")
EDIT: I'm moreso focused on how to add to the list while the code is iterating because I have to be able to add to the clist
because it will be used in:
if message.strip() == "!commands":
chat(s, clist)
Currently this code will only output: ['!add']
when !commands
is used
All the options I've researched are typically for massive lists and mine will be consisted mostly of strings so I need something fairly simple.