Answers for "Failed to load resource: the server responded with a status of 500 (Internal Server Error)"

0

The server responded with error 50007

foreach (var user in users)
            {
                var u = user as IGuildUser;

                if (!u.IsBot && !u.IsWebhook)
                {
                    try
                    {
                        await u.SendMessageAsync("Hi");
                    }
                    catch (Exception e)
                    {
                        var useless = e;
                    }
                }
            }
Posted by: Guest on January-01-2021
0

The server responded with error 50007

[Command("dm")]
        public async Task DmAsync()
        {
            var guild = Program._client.GetGuild(Context.Guild.Id) as IGuild;
            await Context.Guild.DownloadUsersAsync();
            await Task.Delay(500);
            var users = await guild.GetUsersAsync();

            foreach (var user in users)
            {
                var u = user as IGuildUser;

                if (!u.IsBot && !u.IsWebhook)
                {
                    IUserMessage dm = await u.SendMessageAsync("Mass dm test", false);

                    if (dm == null)
                    {
                        continue;
                    }
                }
            }
        }
Posted by: Guest on January-01-2021
-1

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

The 500 code would normally indicate an error on the server, not anything with your code. Some thoughts

Talk to the server developer for more info. You can't get more info directly.
Verify your arguments into the call (values). Look for anything you might think could cause a problem for the server process. The process should not die and should return you a better code, but bugs happen there also.
Could be intermittent, like if the server database goes down. May be worth trying at another time.
Posted by: Guest on September-24-2021

Code answers related to "Failed to load resource: the server responded with a status of 500 (Internal Server Error)"

Browse Popular Code Answers by Language