I have the function below to get all the text from the chat, I would also like to get the username of the user who sends the message for any message on chat.
what would be the best way to do this?
def on_pubmsg(self, connection, event):
chatText = self.string_to_list(event.arguments)
print("searching for commands in chat: ", chatText)
command_indicator = '!'
for text in chatText:
print(text)
if command_indicator in text:
if text[0] == command_indicator:
print("command founded!")