mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-09-22 10:50:18 -04:00
Create /setmotd command; use /motd to display it
/motd displays the motd instead of changing it, so that a (non op) user can see it without having to rejoin. Motd can be set by op with /setmotd
This commit is contained in:
parent
a55b78ccdb
commit
f346fa737a
13
host.go
13
host.go
@ -422,7 +422,7 @@ func (h *Host) InitCommands(c *chat.Commands) {
|
||||
|
||||
c.Add(chat.Command{
|
||||
Op: true,
|
||||
Prefix: "/motd",
|
||||
Prefix: "/setmotd",
|
||||
PrefixHelp: "MESSAGE",
|
||||
Help: "Set the MESSAGE of the day.",
|
||||
Handler: func(room *chat.Room, msg message.CommandMsg) error {
|
||||
@ -446,6 +446,17 @@ func (h *Host) InitCommands(c *chat.Commands) {
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
c.Add(chat.Command{
|
||||
Prefix: "/motd",
|
||||
Help: "Display the MESSAGE of the day.",
|
||||
Handler: func(room *chat.Room, msg message.CommandMsg) error {
|
||||
|
||||
room.Send(message.NewAnnounceMsg(h.motd))
|
||||
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
c.Add(chat.Command{
|
||||
Op: true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user