From 22ec91f6cfb72fab7e9cac6a0039cb1689c6c0e5 Mon Sep 17 00:00:00 2001 From: Rens Rikkerink Date: Thu, 19 Apr 2018 17:41:00 +0200 Subject: [PATCH] Added Mention() func for Channel (#536) * Added Mention() func for Channel * Changed variable name Adding the func in Github was so simple I didn't bother seeing if it'd compile, I shortly after realised my mistake. --- structs.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/structs.go b/structs.go index 9fa6ce6..439a15e 100644 --- a/structs.go +++ b/structs.go @@ -239,6 +239,11 @@ type Channel struct { ParentID string `json:"parent_id"` } +// Mention returns a string which mentions the channel +func (c *Channel) Mention() string { + return fmt.Sprintf("<#%s>", c.ID) +} + // A ChannelEdit holds Channel Feild data for a channel edit. type ChannelEdit struct { Name string `json:"name,omitempty"`