Adding impl for quiet mode with tests.

This commit is contained in:
Nick Presta committed 2015-01-03 01:52:11 -05:00
1 parent 362d0fdffd
commit a2ee2000bb
4 files changed
+139

No files matched your search

+18
View File
@@ -196,6 +196,24 @@ func InitCommands(c *Commands) {
},
})
c.Add(Command{
Prefix: "/quiet",
Help: "Silence announcement-type messages (join, part, rename, etc).",
Handler: func(channel *Channel, msg CommandMsg) error {
u := msg.From()
u.ToggleQuietMode()
var body string
if u.Config.Quiet {
body = "Quiet mode is toggled ON"
} else {
body = "Quiet mode is toggled OFF"
}
channel.Send(NewSystemMsg(body, u))
return nil
},
})
c.Add(Command{
Op: true,
Prefix: "/op",