Skip to content

Commit

Permalink
Hide RP join button if not in public server
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Jul 24, 2023
1 parent 62a44f1 commit 3aafa14
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Bloxstrap/Integrations/DiscordRichPresence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public async Task<bool> SetCurrentGame()
}
};

if (!App.Settings.Prop.HideRPCButtons)
if (!App.Settings.Prop.HideRPCButtons && _activityWatcher.ActivityServerType == ServerType.Public)
{
buttons.Insert(0, new Button
{
Expand All @@ -183,10 +183,17 @@ public async Task<bool> SetCurrentGame()
return false;
}

string status = _activityWatcher.ActivityServerType switch
{
ServerType.Private => "In a private server",
ServerType.Reserved => "In a reserved server",
_ => $"by {universeDetails.Creator.Name}" + (universeDetails.Creator.HasVerifiedBadge ? " ☑️" : ""),
};

_currentPresence = new RichPresence
{
Details = universeDetails.Name,
State = $"by {universeDetails.Creator.Name}" + (universeDetails.Creator.HasVerifiedBadge ? " ☑️" : ""),
State = status,
Timestamps = new Timestamps { Start = _timeStartedUniverse },
Buttons = buttons.ToArray(),
Assets = new Assets
Expand Down

0 comments on commit 3aafa14

Please sign in to comment.