Skip to content

fix: add back removed feature when migrating the discord SDK #221

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

Merged
merged 1 commit into from
Apr 21, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/discord/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ void DiscordInstance::after_ready() {
spdlog::error("Current Connected User Error: {}", result.ToString());
}
);

auto result = m_client.RegisterLaunchCommand(
constants::discord::application_id, constants::discord::platform_dependent_launch_arguments
);
if (not result) {
spdlog::warn("Discord: Failed to Register Launch Command");
};
}


Expand Down
19 changes: 19 additions & 0 deletions src/discord/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@
namespace constants::discord {
constexpr u64 application_id = 1220147916371394650ULL;


//TODO(Totto): this isn't correct for all platforms and needs to be tested
#if defined(__ANDROID__)
#error "Not supported"
#elif defined(__CONSOLE__)
#error "Not supported"
#elif defined(FLATPAK_BUILD)
constexpr const char* platform_dependent_launch_arguments =
"flatpak run io.github.openbrickprotocolfoundation.oopetris --discord";
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
constexpr const char* platform_dependent_launch_arguments = "oopetris.exe --discord";
#elif defined(__APPLE__)
constexpr const char* platform_dependent_launch_arguments = "TODO";
#elif defined(__linux__)
constexpr const char* platform_dependent_launch_arguments = "oopetris --discord";
#else
#error "Unsupported platform"
#endif

#if defined(__ANDROID__)
constexpr const discordpp::ActivityGamePlatforms supported_platforms = discordpp::ActivityGamePlatforms::Android;
#elif defined(__CONSOLE__)
Expand Down
Loading