浏览代码

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.
Rens Rikkerink 7 年之前
父节点
当前提交
22ec91f6cf
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      structs.go

+ 5 - 0
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"`