|
@@ -6,7 +6,6 @@ import (
|
|
|
"fmt"
|
|
|
"io/ioutil"
|
|
|
"net/http"
|
|
|
- "time"
|
|
|
|
|
|
"github.com/bwmarrin/discordgo"
|
|
|
)
|
|
@@ -39,12 +38,6 @@ func main() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- // Register messageCreate as a callback for the messageCreate events.
|
|
|
- dg.AddHandler(messageCreate)
|
|
|
-
|
|
|
- // Open the websocket and begin listening.
|
|
|
- dg.Open()
|
|
|
-
|
|
|
bot, err := dg.User("@me")
|
|
|
if err != nil {
|
|
|
fmt.Println("error fetching the bot details,", err)
|
|
@@ -77,11 +70,3 @@ func changeAvatar(s *discordgo.Session) {
|
|
|
fmt.Println(err)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-// This function will be called (due to AddHandler above) every time a new
|
|
|
-// message is created on any channel that the autenticated bot has access to.
|
|
|
-func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|
|
-
|
|
|
- // Print message to stdout.
|
|
|
- fmt.Printf("%-20s %-20s\n %20s > %s\n", m.ChannelID, time.Now().Format(time.Stamp), m.Author.Username, m.Content)
|
|
|
-}
|