Skip to content

Commit

Permalink
Fix greeting bots
Browse files Browse the repository at this point in the history
  • Loading branch information
chilipizdrick committed Apr 5, 2024
1 parent 37dceb0 commit bacadb9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion commands/switch_dm_on_mention.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
var SwitchDMOnMentionCommand = utl.SlashCommand{
CommandData: &discord.ApplicationCommand{
Name: "switch-dm-on-mention",
Description: "Switch DM on mention functionality on this server.",
Description: "[NOT CURRNETLY WORKING] Switch DM on mention functionality on this server.",
},
CommandHandler: func(s *discord.Session, i *discord.InteractionCreate) {
guildData, err := utl.LoadGuildFromDBByID(i.GuildID)
Expand Down
5 changes: 5 additions & 0 deletions events/voice_state_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ func greetingHandler(s *discord.Session, e *discord.VoiceStateUpdate) error {
return nil
}

// Return if user is a bot
if e.Member.User.Bot {
return nil
}

sqliteDatabaseFilepath := os.Getenv("SQLITE_DATABASE_FILEPATH")
if sqliteDatabaseFilepath == "" {
sqliteDatabaseFilepath = "./userdata/userdata.sqlite3.db"
Expand Down
14 changes: 1 addition & 13 deletions utils/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,13 @@ import (
type User struct {
ID uint
DiscordUserID string
DiscordGuildID string
GreetingEnabled bool
GreetingUnixTimestamp int64
BirthdayDate string // In MM/DD format
LastBirthdayGreetingYear int
}

// type BirthdayUser struct {
// ID uint
// DiscordUserId string
// BirthdayDate string // In MM/DD format
// LastGreetingYear int
// }

// type GreetedUser struct {
// ID uint
// DiscordUserId string
// GreetingUnixTimestamp int64
// }

type Guild struct {
ID uint
DiscordGuildID string
Expand Down

0 comments on commit bacadb9

Please sign in to comment.