Phineas / lanyard

🏷️   Expose your Discord presence and activities to a RESTful API and WebSocket in less than 10 seconds
https://discord.gg/lanyard
MIT License
967 stars 143 forks source link

Needed help. #147

Closed smhman closed 2 years ago

smhman commented 2 years ago

Hello!

Basically I have some problems with my website. At first, timestamps are not working correctly. image And second. Song/video doesnt update some times image And finally. When presence doesnt have timestamp, console goes crazy. image

dustinrouillard commented 2 years ago

This is not a lanyard issue, you've already asked in the discord and received an answer sufficient to solve your issue.

Lanyard doesn't do any processing on the data. Just returns what discord gives us, the start and end timestamp need to be used for calculation, in the same way the discord client does.

In the case of both start and end timestamp existing, you calculate (end-start) and that's the how long in milliseconds that activity will be going on for, and from there you can do all kinds of things, like to get time till end of song take the current date milliseconds and subtract it from the end timestamp.

As for the issue where it errors with no timestamps, that's also your code, you need to properly check it's defined first, not every RPC on discord is meant to have timestamps.

Closing this, as this is not a support channel for non-lanyard related bugs, this is with your implementation of the math, please try using discord again for this.