support MOTD command

This commit is contained in:
tali 2024-01-08 01:15:41 -05:00
parent d340708d4f
commit bdf31dac5b
1 changed files with 2 additions and 0 deletions

View File

@ -161,6 +161,7 @@ let on_msg t (msg : Irc.Msg.t) : unit =
on_msg_user t username modestr realname
| "QUIT", why ->
on_msg_quit t why
| "MOTD", _ -> `motd
| "PRIVMSG", tgt :: msg :: _ ->
on_msg_privmsg t tgt msg
| "PRIVMSG", [_] -> `notexttosend | "PRIVMSG", [] -> `norecipient
@ -173,6 +174,7 @@ let on_msg t (msg : Irc.Msg.t) : unit =
| `ok -> ()
| `quit -> cleanup t
| `welcome -> rpl_welcome t; rpl_motd t
| `motd -> rpl_motd t
| `names (cp, ch, us) -> rpl_names t cp ch us
| `tryagain -> rpl_tryagain t msg.command
| `alreadyregistered -> err_alreadyregistered t