change channel struct
This commit is contained in:
1 parent
d510488d3f
commit
5f9b838af5
2 files changed
+8
-6
No files matched your search
@@ -19,11 +19,11 @@ func Discord(token string, channelId string) *discord {
|
||||
}
|
||||
}
|
||||
|
||||
func (d *discord) BeginRead(tweetchannel chan<- string) {
|
||||
func (d *discord) BeginRead(tweetchannel chan<- *discordgo.MessageCreate) {
|
||||
d.read(tweetchannel)
|
||||
}
|
||||
|
||||
func (d *discord) read(tweetchannel chan<- string) {
|
||||
func (d *discord) read(tweetchannel chan<- *discordgo.MessageCreate) {
|
||||
dgsession, err := discordgo.New("Bot " + d.Token)
|
||||
if err != nil {
|
||||
return
|
||||
@@ -31,7 +31,7 @@ func (d *discord) read(tweetchannel chan<- string) {
|
||||
|
||||
dgsession.AddHandler(func(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||
if m.ChannelID == d.ChannelID && m.Author.ID != s.State.User.ID {
|
||||
tweetchannel <- m.Content
|
||||
tweetchannel <- m
|
||||
}
|
||||
})
|
||||
d.dgsession = dgsession
|
||||
|
||||
Reference in new issue
Block a user