3 Commits

Author SHA1 Message Date
6aeb64be75 timeout fix
- timeouts were not being updated
2025-06-04 16:23:21 -04:00
87d25659be removing extra intents 2025-06-04 16:18:18 -04:00
9c4c6b882e comment fix 2025-06-04 16:15:56 -04:00
2 changed files with 9 additions and 6 deletions

13
bolt.go
View File

@@ -13,14 +13,16 @@ import (
const (
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.IntentMessageContent |
// dg.IntentsGuildMessages
BOT_INTENTS = dg.IntentsAllWithoutPrivileged |
dg.IntentGuildMembers |
BOT_INTENTS = dg.IntentGuildMembers |
dg.IntentGuildPresences |
dg.IntentMessageContent
dg.IntentMessageContent |
dg.IntentsGuildMessages
)
// basic bot structure containing discordgo connection as well as the command map
@@ -151,6 +153,7 @@ func (b *bolt) messageHandler(s *dg.Session, msg *dg.MessageCreate) {
//update run time
run.LastRun = time.Now()
b.Commands[run.Trigger] = run
}
}

View File

@@ -3,7 +3,7 @@ package bolt
import "time"
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
Timeout time.Duration //the amount of time before command can run again
LastRun time.Time //timestamp of last command run