(Python) How can I get the username of someone who sent a command to my chatbot?

e.source.nick for the user’s logon name

If you need the displayed name, you’ll have to get it from e.tags (key=“display_name”)