I got a bot from this website, and I've been having a lot of fun with it. However I wanted to add an away command. The way it's gonna work is that when someone write
away [reason]
then it saves the reason, and when someone else types his name, the bot sais "He is not available, he left a note '[reason]'" or something like that. The input I get when someone writes to the bot is
:[email protected]
PRIVMSG #mychat :away Im going
fishing.
Using this
line[0][line[0].index(":")+1:line[0].index("!")]
I got the username of the person (in this case, it's NickName), and I need to extract all lines after away, using line[4:] (Im going fishing), and that works like a charm. But I need to make it into a string, because it can't return a string and a list.
tl;dr I get a list as a value, and I want it to return it with a string, what do I do?