Skip to content

Enhance Discord presence with player info#719

Open
Klaus-Michealson wants to merge 1 commit intoQbox-project:mainfrom
Klaus-Michealson:patch-1
Open

Enhance Discord presence with player info#719
Klaus-Michealson wants to merge 1 commit intoQbox-project:mainfrom
Klaus-Michealson:patch-1

Conversation

@Klaus-Michealson
Copy link
Copy Markdown

@Klaus-Michealson Klaus-Michealson commented Nov 10, 2025

Updated Discord presence handling to include player count and player name.

Description

Checklist

  • I have personally loaded this code into an updated Qbox project and checked all of its functionality.
  • My pull request fits the contribution guidelines & code conventions.

Updated Discord presence handling to include player count and player name.
Comment thread client/discord.lua
end
end)

RegisterNetEvent('discord:updatePresence', function(currentCount)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be a function rather than an event.

Comment thread client/discord.lua
Comment on lines +32 to +35
CreateThread(function()
Wait(5000)
TriggerEvent('discord:updatePresence', GlobalState.PlayerCount or 0)
end)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for? Why are we waiting 5 seconds?

Comment thread client/discord.lua
@@ -1,18 +1,35 @@
local maxPlayers = GlobalState.MaxPlayers
local maxPlayers = GlobalState.MaxPlayers or GetConvarInt('sv_maxclients', 64)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants