structure, state and connecting to discord
This commit is contained in:
parent
7152ea59fa
commit
c70359d412
7 changed files with 189 additions and 15 deletions
9
events/messageCreate.go
Normal file
9
events/messageCreate.go
Normal file
|
@ -0,0 +1,9 @@
|
|||
package events
|
||||
|
||||
import "github.com/bwmarrin/discordgo"
|
||||
|
||||
func MessageCreate(session *discordgo.Session, msg *discordgo.MessageCreate) {
|
||||
if (msg.Author.ID == session.State.User.ID) {
|
||||
return
|
||||
}
|
||||
}
|
13
events/ready.go
Normal file
13
events/ready.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package events
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/fatih/color"
|
||||
)
|
||||
|
||||
func Ready(session *discordgo.Session, event *discordgo.Ready) {
|
||||
fmt.Print("Logged in as: ")
|
||||
color.Yellow("%s (%s)", session.State.User.Username, session.State.User.ID)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue