4 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
217afeab71 trying new permissions 2025-06-04 16:12:48 -04:00
2 changed files with 11 additions and 3 deletions

12
bolt.go
View File

@@ -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
} }
} }

View File

@@ -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