mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-20 18:57:41 +03:00
feat: add systembell command
This commit is contained in:
parent
21120a5aa6
commit
f62e591523
@ -264,6 +264,26 @@ func InitCommands(c *Commands) {
|
||||
},
|
||||
})
|
||||
|
||||
c.Add(Command{
|
||||
Prefix: "/systembell",
|
||||
Help: "Toggle system bell for all messages.",
|
||||
Handler: func(room *Room, msg message.CommandMsg) error {
|
||||
u := msg.From()
|
||||
cfg := u.Config()
|
||||
cfg.Systembell = !cfg.Systembell
|
||||
u.SetConfig(cfg)
|
||||
|
||||
var body string
|
||||
if cfg.Systembell {
|
||||
body = "System bell is toggled ON"
|
||||
} else {
|
||||
body = "System bell is toggled OFF"
|
||||
}
|
||||
room.Send(message.NewSystemMsg(body, u))
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
c.Add(Command{
|
||||
Prefix: "/slap",
|
||||
PrefixHelp: "NAME",
|
||||
|
Loading…
x
Reference in New Issue
Block a user