Skip to content

Commit

Permalink
Auto add members role to ppl who join forsens server
Browse files Browse the repository at this point in the history
  • Loading branch information
pajlada committed Apr 1, 2024
1 parent 104b76e commit 98effdd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/bot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,13 @@ func banIfUserIsYoungerThan(s *discordgo.Session, m *discordgo.GuildMemberAdd, m
func onUserJoined(s *discordgo.Session, m *discordgo.GuildMemberAdd) {
postUserInfo(s, m.Member, "User Joined")

if m.GuildID == forsenServerID {
fmt.Printf("Granting members role to %s (%s)\n", m.User.Username, m.User.ID)
if err := s.GuildMemberRoleAdd(m.GuildID, m.User.ID, membersRole); err != nil {
fmt.Println("Error adding Members role to user:", err)
}
}

// banIfUserIsYoungerThan(s, m, 1*time.Hour)
}

Expand All @@ -792,6 +799,8 @@ func onUserLeft(s *discordgo.Session, m *discordgo.GuildMemberRemove) {
// const weebMessageID = `552788256333234176`
const weebMessageID = `889819209507438603`
const reactionBye = "👋"
const membersRole = `825354461102473226`
const forsenServerID = `97034666673975296`

func onMessageReactionAdded(s *discordgo.Session, m *discordgo.MessageReactionAdd) {
targetChannel := serverconfig.Get(m.GuildID, "channel:weeb-channel")
Expand Down

0 comments on commit 98effdd

Please sign in to comment.