summaryrefslogtreecommitdiff
path: root/commands.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands.go')
-rw-r--r--commands.go14
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]