Raku / whateverable

🤖 Different IRC bots that operate on a bunch of prebuilt Rakudo versions
https://gist.github.com/Whateverable
GNU Affero General Public License v3.0
18 stars 14 forks source link

Tellable should respond to private messages #374

Open treyharris opened 4 years ago

treyharris commented 4 years ago

Since you have to mention the nick if you want to .tell, if the user leaves themselves afk on the channel, you take the risk of setting off a sleepytime notification in simply mentioning them in the .tell. So I’d suggest either:

  1. A change to irc-privmsg-me so that you can /MSG tellable6 tell i>nick</i>@<ichannel …; or
  2. A change to normalize-weirdly to strip out tildes (~), which are not allowed in nicks. Then you can do .tell trey~harris or some-such to keep the channel from ringing the user.

I’m capable of submitting a PR for either if you want to just select one. Thanks!

treyharris commented 4 years ago

Btw, looking at normalize-weirdly: underscores are valid nick characters, so I think this may cause bad behavior for users with underscore-containing nicks?

A valid PCRE for valid nicks not including Unicode extensions is:

/\A[a-z_\-\[\]\\^{}|`][a-z0-9_\-\[\]\\^{}|`]*\z/i

And the Unicode extensions (which should be pretty easy to add in Raku) are shown here.

treyharris commented 4 years ago

Actually, that last comment doesn’t belong here. I’ll promote it to its own issue.

AlexDaniel commented 4 years ago

Yes, tellable6 should start responding to private messages. It's blocked by default here because there are all kinds of damage you can do via private messages (in case of tellable it can be something stupid like sending a message to each user on the channel resulting in annoying bot spam). Better safe than sorry, but in case of tellable6 we should probably be a bit more permissive.

As for normalize-weirdly, it's designed to be that way. For example, it's so that when you send a message to Coke (which users do often) it gets received by [Coke] and vice versa. Yes, these are distinct nicknames and of course different users can have them at the same time, but in practice that never happens on our channels. This function was designed by analyzing messages that were never delivered by the previous bot, and it works like a treat. Technically it's wrong, but reality is that users are constantly changing their nicknames and people don't remember all the intricate details of every nickname.

AlexDaniel commented 4 years ago

I'm pretty sure this is now working (some bots will start responding to private messages after they're updated). Tests needed.