How can I add value to an existing list of YAML files using the discord.py command?
here's what I've tried:
@bot.command()
async def addwhitelist(ctx, id : int=None):
with open("./config.yml", "r") as file:
data = file.readlines()
data[0][49] = f", {id}"
with open("./config.yml", "w") as file:
file.writelines(data)
file.close()
and here's what's the list:
Whitelist: [483686172221243402, 740936250608844890]
NOTE: I want it to add more than once so whenever I want to add a new value to that list.
so how can I do that?