cjlucas / ralph

A bot for developers
0 stars 0 forks source link

Add remaining commands and hooks #12

Open cjlucas opened 4 years ago

cjlucas commented 4 years ago

There's a bunch of commands and message-based events we don't support. Let's add em.

This relates to #4. But should focus on unsupported messages.

cjlucas commented 4 years ago

Marking as needs more info. Need to actually go through the RFC and make a list of all the commands/events we want to support.

cjlucas commented 4 years ago

When adding each command go through this checklist

cjlucas commented 4 years ago

From RFC 2812

   3.  Message Details ............................................   9
      3.1  Connection Registration ................................  10
         3.1.1  Password message ..................................  10
         3.1.2  Nick message ......................................  10
         3.1.3  User message ......................................  11
         3.1.4  Oper message ......................................  12
         3.1.5  User mode message .................................  12
         3.1.6  Service message ...................................  13
         3.1.7  Quit ..............................................  14
         3.1.8  Squit .............................................  15
      3.2  Channel operations .....................................  15
         3.2.1  Join message ......................................  16
         3.2.2  Part message ......................................  17
         3.2.3  Channel mode message ..............................  18
         3.2.4  Topic message .....................................  19
         3.2.5  Names message .....................................  20
         3.2.6  List message ......................................  21
         3.2.7  Invite message ....................................  21
         3.2.8  Kick command ......................................  22
      3.3  Sending messages .......................................  23
         3.3.1  Private messages ..................................  23
         3.3.2  Notice ............................................  24
      3.4  Server queries and commands ............................  25
         3.4.1  Motd message ......................................  25
         3.4.2  Lusers message ....................................  25
         3.4.3  Version message ...................................  26
         3.4.4  Stats message .....................................  26
         3.4.5  Links message .....................................  27
         3.4.6  Time message ......................................  28
         3.4.7  Connect message ...................................  28
         3.4.8  Trace message .....................................  29
         3.4.9  Admin command .....................................  30
         3.4.10 Info command ......................................  31
      3.5  Service Query and Commands .............................  31
         3.5.1  Servlist message ..................................  31
         3.5.2  Squery ............................................  32
      3.6  User based queries .....................................  32
         3.6.1  Who query .........................................  32
         3.6.2  Whois query .......................................  33
         3.6.3  Whowas ............................................  34
      3.7  Miscellaneous messages .................................  34
         3.7.1  Kill message ......................................  35
         3.7.2  Ping message ......................................  36
         3.7.3  Pong message ......................................  37
         3.7.4  Error .............................................  37
cjlucas commented 4 years ago

I'll probably want to start doing proper responses too. For example, the INVITE message can return a successful response (RPL_INVITING) or an error (ERR_NEEDMOREPARAMS). We'll want to return an idiomatic response to the user :ok or {:error, :missing_params}.


Edit: Proper reply handling will need some thinking, and likely support for dynamic hooks (related: #2). Think of the USERS command, which has three distinct reply types:

Because the IRC protocol is inherently asynchronous. We would need a reply manager.