lizmat / IRC-Client

Raku module for building IRC (Internet Relay Chat) clients
https://raku.land/zef:lizmat/IRC::Client
Artistic License 2.0
15 stars 8 forks source link

Allow alternate nicknames for bots #22

Closed MasterDuke17 closed 8 years ago

MasterDuke17 commented 8 years ago

I believe there was some discussion on IRC, but I don't remember the conclusion. It would let people use things like e.g., bench for benchable, bisect for bisectable. You could always implement it by hand with irc-all(), but that seems like overkill. Maybe it would be as simple as turning this: if $e.text.subst-mutate: /^ $nick <[,:]> \s* /, '' { into this: if $e.text.subst-mutate: /^ @nicks <[,:]> \s* /, '' {

zoffixznet commented 8 years ago

Added in version 3.006001 as :alias argument. It can take a list of Str or Regex and functions as an alias to the currently used nick:

    .run with IRC::Client.new:
        :nick<Foo>
        :alias('bar', /meow [able]?/);

   ##
   # Foo, do stuff
   # bar, do stuff
   # meow, do stuff
   # meowable, do stuff
AlexDaniel commented 8 years ago

Amazing! Thank you