diff options
author | delthas <delthas@dille.cc> | 2022-11-22 11:10:05 +0100 |
---|---|---|
committer | delthas <delthas@dille.cc> | 2022-11-22 11:10:05 +0100 |
commit | c7d2032082d3f96dafbe92d774feb98b0fa0af4d (patch) | |
tree | 4fc489ebf3ab8c7072cd0032aaf6c41f7699657f /commands.go | |
parent | Support irc URLs in the config addr (diff) |
Implement /MOTD
Diffstat (limited to 'commands.go')
-rw-r--r-- | commands.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/commands.go b/commands.go index 132f914..55582a0 100644 --- a/commands.go +++ b/commands.go @@ -65,6 +65,10 @@ func init() { Desc: "send a message to the given target", Handle: commandDoMsg, }, + "MOTD": { + Desc: "show the message of the day (MOTD)", + Handle: commandDoMOTD, + }, "NAMES": { Desc: "show the member list of the current channel", Handle: commandDoNames, @@ -345,6 +349,16 @@ func commandDoMsg(app *App, args []string) (err error) { return commandSendMessage(app, target, content) } +func commandDoMOTD(app *App, args []string) (err error) { + netID, _ := app.win.CurrentBuffer() + s := app.sessions[netID] + if s == nil { + return errOffline + } + s.MOTD() + return nil +} + func commandDoNames(app *App, args []string) (err error) { netID, buffer := app.win.CurrentBuffer() s := app.sessions[netID] |