Failed to load resource: the server responded with a status of 500 (Internal Server Error) code example
Example 1: failed to load resource: the server responded with a status of 404 (not found)
<script src="../../Jquery/prettify.js"></script>
Example 2: 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;
}
}
}
Example 3: 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;
}
}
}
}
Example 4: failed to load resource the server responded with a status of 400 ()
The answer was the Wrapper class. It couldn't assign values to it and threw error because i set attributes to "private". Setting them "public" solved it for me.
Can't believe that was the error...