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

Timestamps. End. #392

Open
Vusal-Shabiev opened this issue Mar 18, 2024 · 3 comments
Open

Timestamps. End. #392

Vusal-Shabiev opened this issue Mar 18, 2024 · 3 comments

Comments

@Vusal-Shabiev
Copy link

Vusal-Shabiev commented Mar 18, 2024

Hello everyone, I can’t figure it out with TimeStamps. I tried TimeStamp.FromSecond(100), for example. Everything worked. When I send real time it doesn't work? The textbox shows this real time, what's wrong in my code?

try {
    //Set the rich presence
    //Call this as many times as you want and anywhere in your code.
    client.SetPresence(new RichPresence()
    {
        Details =  audio.Artist,
        State = audio.Title,
        Assets = new Assets()
        {
            LargeImageKey = "vk_logo",
            LargeImageText = "Cлушает в VK Player",
            SmallImageKey = ""
        },

        Timestamps = new Timestamps()
        {
            Start = DateTime.UtcNow,
            End = DateTime.UtcNow + TimeSpan.FromSeconds(endtime),
        },
    }) ; 
}
catch
{

}

private void SetEndTime(object Object, EventArgs e)
{
    int Seconds = (int)Player.NaturalDuration.TimeSpan.TotalSeconds;
    DurationSlider.Maximum = Seconds;
    int Minutes = Seconds / 60;
    int MinutedDS = Seconds;
    Seconds -= Minutes * 60;
    string strSeconds = $"{Seconds}";
    if (Seconds < 10)
    {
        strSeconds = $"0{Seconds}";
    }
    string EndTime = $"{Minutes}:{strSeconds}";
    TimeEndInfoLabel.Text = EndTime;
    endtime = MinutedDS + Seconds;
}

public double endtime;
@Lachee
Copy link
Contributor

Lachee commented Mar 18, 2024

What library are you using? Are you using my library? If so the issue is better opened on the repository for that.
Regardless, your code only sets the presence once? Your SetEndTime never calls client.SetPresence

@Vusal-Shabiev
Copy link
Author

Какую библиотеку вы используете? Вы пользуетесь моей библиотекой? Если да, то для этого лучше открыть проблему в репозитории. Тем не менее, ваш код устанавливает присутствие только один раз? Ваш SetEndTime никогда не вызываетclient.SetPresence

Yes, I use your library. My SetEndTime is called in the code to play a song, and the name of the song and author are also displayed there. I tried to display the remaining time, but it doesn't work. Maybe you know the solution?

@Vusal-Shabiev
Copy link
Author

So sorry, I'm opened issue in repository for Discord RPC C#.

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

No branches or pull requests

2 participants