How do I log PM's directed at a bot? reddit / irc ---------------------------------------------------------------------- ps4star · 2016-07-22 00:34 So I made a Python bot for twitch and I need to be able to get PM's aimed at the bot so that the main chat won't be flooded with commands that could just be PM'ed to the bot instead, but I don't know how to do this :I. ---------------------------------------------------------------------- Jonno_FTW · 2016-07-22 09:20 Are you using a framework? You can always just check if the line from the server indicates that it's being sent to the bot's username. ---------------------------------------------------------------------- MachaHack · 2016-07-22 21:33 So a raw protocol message looks like this: `:Macha!~macha@unaffiliated/macha PRIVMSG #botwar :Test response` This is the message "Test Response" sent by the User Macha to the channel #botwar. A message sent to a bot would look like: `:Macha!~macha@unaffiliated/macha PRIVMSG SomeRandomBot :Test response` Note that in the target field of the message, it's the username of the bot (`SomeRandomBot`) rather than a channel name. If you're using some higher level library, it should provide you an API to access that field, but without knowing what library you're using, I can't tell you what it's called. ---------------------------------------------------------------------- ps4star · 2016-07-23 00:26 So if someone was private messaging someone their message would be `PRIVMSG User Message' instead of 'PRIVMSG #channel Message'? ---------------------------------------------------------------------- ps4star · 2016-07-23 00:27 Oh k thanks. ---------------------------------------------------------------------- Jonno_FTW · 2016-07-23 00:32 Yes. You can always just test this yourself if you're not sure. ---------------------------------------------------------------------- ps4star · 2016-07-23 00:36 k thank you