Search Results for

    Show / Hide Table of Contents

    Workarounds

    Here is a collection of common workarounds for minor problems.

    Thread warns with .. take too long to execute

    This warning happens from time to time if you're doing big tasks on events. A quick workaround for this warning is the following method:

    discordClient.VoiceStateUpdated += (sender, args) =>
    {
        Task.Run(async () => await DiscordClientOnVoiceStateUpdated(sender, args));
        return Task.CompletedTask;
    };
    

    With this you start a new non-blocking thread.

    Another alternative is:

    new Thread(Method).Start()
    
    • Improve this Doc
    In This Article
    Back to top © 2021-2022 Aiko IT Systems