Skip to content

Commit 7bf7559

Browse files
author
Syfaro
committed
Add NewMessageToChannel for #45.
1 parent 369364b commit 7bf7559

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

helpers.go

+12
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ func NewMessage(chatID int64, text string) MessageConfig {
1818
}
1919
}
2020

21+
// NewMessageToChannel creates a new Message that is sent to a channel
22+
// by username.
23+
// username is the username of the channel, text is the message text.
24+
func NewMessageToChannel(username string, text string) MessageConfig {
25+
return MessageConfig{
26+
BaseChat: BaseChat{
27+
ChannelUsername: username,
28+
},
29+
Text: text,
30+
}
31+
}
32+
2133
// NewForward creates a new forward.
2234
//
2335
// chatID is where to send it, fromChatID is the source chat,

0 commit comments

Comments
 (0)