Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

Commit

Permalink
Temporary patch for deverif email bug
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed Jan 7, 2020
1 parent a00cadf commit a668f4e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 66 deletions.
52 changes: 0 additions & 52 deletions .Route(web.Routes)/center.go

This file was deleted.

50 changes: 36 additions & 14 deletions loadchannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ func actualLoadChannel(channelID int64) {
}
}

log.Println("Booted stage 1")
time.Sleep(10 * time.Second)

switch ch.Type {
case discordgo.ChannelTypeGuildVoice:
Message("Voice is currently not working D:")
Expand Down Expand Up @@ -88,10 +91,16 @@ func actualLoadChannel(channelID int64) {
return
}

log.Println("Booted stage 2")
time.Sleep(10 * time.Second)

ch.Messages = msgs

if len(msgs) > 0 {
go func(c *discordgo.Channel, msgs []*discordgo.Message) {
log.Println("Prepare to ack...")
time.Sleep(3 * time.Second)
log.Println("Acking...")
ackMe(c.ID, msgs[len(msgs)-1].ID)
}(ch, msgs)
}
Expand All @@ -115,6 +124,9 @@ func actualLoadChannel(channelID int64) {
return
}

log.Println("Booted stage 3")
time.Sleep(2 * time.Second)

d.GatewayManager.SubscribeGuild(
Channel.GuildID, true, true,
)
Expand All @@ -129,8 +141,14 @@ func actualLoadChannel(channelID int64) {
}
}

log.Println("Halting stage 4...")
return

recurseMembers(members, ch.GuildID, 0)

log.Println("Booted stage 4")
time.Sleep(2 * time.Second)

guild.Members = *members

roles := guild.Roles
Expand Down Expand Up @@ -239,21 +257,25 @@ func messageisOld(m, l *discordgo.Message) bool {
}

func recurseMembers(memstore *[]*discordgo.Member, guildID, after int64) {
members, err := d.GuildMembers(guildID, after, 1000)
if err != nil {
log.Println(err)
return
}
return

if len(members) == 1000 {
recurseMembers(
memstore,
guildID,
members[999].User.ID,
)
}
/*
members, err := d.GuildMembers(guildID, after, 1000)
if err != nil {
log.Println(err)
return
}
*memstore = append(*memstore, members...)
if len(members) == 1000 {
recurseMembers(
memstore,
guildID,
members[999].User.ID,
)
}
return
*memstore = append(*memstore, members...)
return
*/
}

0 comments on commit a668f4e

Please sign in to comment.