Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Discord party invites being blocked #20606

Merged
merged 2 commits into from Jan 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 14 additions & 8 deletions OpenRA.Mods.Common/DiscordService.cs
Expand Up @@ -115,6 +115,7 @@ void SetStatus(DiscordState state, string details = null, string secret = null,
DateTime? timestamp = null;
Party party = null;
Secrets secrets = null;
Button[] buttons = null;

switch (state)
{
Expand Down Expand Up @@ -161,6 +162,18 @@ void SetStatus(DiscordState state, string details = null, string secret = null,
throw new ArgumentOutOfRangeException(nameof(state), state, null);
}

if (party == null)
{
buttons = new[]
{
new Button
{
Label = "Visit Website",
Url = Game.ModData.Manifest.Metadata.Website
}
};
}

var richPresence = new RichPresence
{
Details = details,
Expand All @@ -173,14 +186,7 @@ void SetStatus(DiscordState state, string details = null, string secret = null,
Timestamps = timestamp.HasValue ? new Timestamps(timestamp.Value) : null,
Party = party,
Secrets = secrets,
Buttons = new[]
{
new Button
{
Label = "Visit Website",
Url = Game.ModData.Manifest.Metadata.Website
}
}
Buttons = buttons
};

client.SetPresence(richPresence);
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
Expand Up @@ -5,7 +5,7 @@
</ProjectReference>
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="OpenRA-FuzzyLogicLibrary" Version="1.0.1" />
<PackageReference Include="DiscordRichPresence" Version="1.0.175" />
<PackageReference Include="DiscordRichPresence" Version="1.1.3.18" />
<PackageReference Include="MP3Sharp" Version="1.0.5" />
<PackageReference Include="NVorbis" Version="0.10.4" />
<PackageReference Include="TagLibSharp" Version="2.2.0" />
Expand Down