Skip to content

Commit

Permalink
Fixed crashing problem thank the lawd
Browse files Browse the repository at this point in the history
  • Loading branch information
IshaanRao committed Jul 31, 2023
1 parent db77f6d commit 4232def
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions fragbots/client/fragbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func (fb *FragBot) onParty(ign string) {
// Checks whether user is supposed to be able to party bot
if fragBotUser == nil || (botType == Priority && !fragBotUser.Priority) || fragBotUser.Discord == "unknown" || ((!fragBotUser.Priority && !fragBotUser.Exclusive) && ((botType == Exclusive) || (botType == Whitelisted && !fragBotUser.Whitelisted) || (botType == Active && !fragBotUser.Active))) {
logging.Log("(No Access) Rejected party invite from: " + ign)
return
}
queueLen := fb.Queue.GetTotalQueuedTasks()
if (queueLen >= 10 && (botType == Verified || botType == Whitelisted || botType == Active)) || (queueLen >= 5 && (botType == Exclusive || botType == Priority)) {
Expand All @@ -125,11 +126,6 @@ func (fb *FragBot) onParty(ign string) {
logging.SendEmbedThumbnail(fb.data.DiscInfo.LogWebhook, fb.data.AccountInfo.Username, ign+" just partied "+fb.data.AccountInfo.Username+"!\nQueue Position: "+strconv.FormatInt(int64(queueLen), 10)+"\nEstimated Time: `"+strconv.FormatInt(int64(((queueLen-1)*(fb.waitTime+1))+1), 10)+" seconds"+"`", "https://mc-heads.net/avatar/"+ign)

logging.Log("Received party invite from: " + ign)
if fb == nil {
logging.Log("Fragbot became nil")
} else if fb.requester == nil {
logging.Log("Requester became nil")
}
if err := fb.requester.addUse(fragBotUser.Id); err != nil {
logging.LogWarn("AddUse failed for: "+ign+", err:", err)
}
Expand Down
2 changes: 1 addition & 1 deletion fragbots/logging/embeds.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const FooterIcon = "https://cdn.discordapp.com/emojis/823999418592264232.webp?size=240&quality=lossless"
const DefaultEmbedColor = 3388927
const Version = "3.0.3"
const Version = "3.1.0"

// https://github.com/bensch777/discord-webhook-golang/blob/v0.0.5/discordwebhook.go

Expand Down

0 comments on commit 4232def

Please sign in to comment.