discord.py different outputs depens on user

  discord, discord.py, python

It was a long time ago I coded and kinda forget the most part.
But I want to make a command that sends different outputs depends on who said the command and DON’T want it to be random.

This is may be a better explanation, I have a command that will show all the stuff you need to do (so a to do list but each user have their own list) I want to be able add a new task by the command !add <task> but that task will just be added for the user who wrote the command. All other users will still have their own list.

I am not sure how I could do this in the best way, especially how to make everyone has their own list and not the same. That’s where I am stuck

Thanks for all help!

Source: Python Questions

One Reply to “discord.py different outputs depens on user”

  • I don’t understand what is your problem – it doesn’t need “the best way”. I needs only normal dictionary

    data = { user_name: own_list, … }

    And dictionary has to be global variable to get access every time when you get command.

    You could eventually save it in database or file (ie. JSON or pickle) to load it again if you would have to restart bot.

LEAVE A COMMENT