Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
6aeb64be75 | |||
87d25659be | |||
9c4c6b882e | |||
217afeab71 |
12
bolt.go
12
bolt.go
@@ -13,9 +13,16 @@ import (
|
|||||||
const (
|
const (
|
||||||
TOKEN_ENV_VAR = "DISCORD_TOKEN" //label for token environment variable
|
TOKEN_ENV_VAR = "DISCORD_TOKEN" //label for token environment variable
|
||||||
|
|
||||||
BOT_INTENTS = dg.IntentGuildMembers | //discord permissions for the bot
|
// BOT_INTENTS = dg.IntentsAllWithoutPrivileged |
|
||||||
|
// dg.IntentGuildMembers |
|
||||||
|
// dg.IntentGuildPresences |
|
||||||
|
// dg.IntentMessageContent |
|
||||||
|
// dg.IntentsGuildMessages
|
||||||
|
|
||||||
|
BOT_INTENTS = dg.IntentGuildMembers |
|
||||||
dg.IntentGuildPresences |
|
dg.IntentGuildPresences |
|
||||||
dg.IntentMessageContent
|
dg.IntentMessageContent |
|
||||||
|
dg.IntentsGuildMessages
|
||||||
)
|
)
|
||||||
|
|
||||||
// basic bot structure containing discordgo connection as well as the command map
|
// basic bot structure containing discordgo connection as well as the command map
|
||||||
@@ -146,6 +153,7 @@ func (b *bolt) messageHandler(s *dg.Session, msg *dg.MessageCreate) {
|
|||||||
|
|
||||||
//update run time
|
//update run time
|
||||||
run.LastRun = time.Now()
|
run.LastRun = time.Now()
|
||||||
|
b.Commands[run.Trigger] = run
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@ package bolt
|
|||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
type Command struct {
|
type Command struct {
|
||||||
Trigger string //.command that triggers payload NOT including the '.'
|
Trigger string //.command that triggers payload INCLUDING the '.'
|
||||||
Payload Payload //payload function to run when a command is detected
|
Payload Payload //payload function to run when a command is detected
|
||||||
Timeout time.Duration //the amount of time before command can run again
|
Timeout time.Duration //the amount of time before command can run again
|
||||||
LastRun time.Time //timestamp of last command run
|
LastRun time.Time //timestamp of last command run
|
||||||
|
Reference in New Issue
Block a user