mirror of
https://github.com/yawaflua/PL_JusticeBot.git
synced 2026-02-05 02:54:12 +02:00
add try_catch
This commit is contained in:
@@ -22,6 +22,8 @@ namespace DiscordApp.Controllers
|
|||||||
Startup.appDbContext.SaveChanges();
|
Startup.appDbContext.SaveChanges();
|
||||||
return Redirect(data.url);
|
return Redirect(data.url);
|
||||||
}else if (data.RedirectType == Types.RedirectType.Redirected)
|
}else if (data.RedirectType == Types.RedirectType.Redirected)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var guild = Startup.discordSocketClient.GetGuild(1107742957458685985);
|
var guild = Startup.discordSocketClient.GetGuild(1107742957458685985);
|
||||||
var channel = guild.GetChannel(channelid) as ITextChannel;
|
var channel = guild.GetChannel(channelid) as ITextChannel;
|
||||||
@@ -35,6 +37,10 @@ namespace DiscordApp.Controllers
|
|||||||
});
|
});
|
||||||
|
|
||||||
return Redirect(message.GetJumpUrl());
|
return Redirect(message.GetJumpUrl());
|
||||||
|
}catch(Exception ex)
|
||||||
|
{
|
||||||
|
return Ok($"500: Error in discord client. Text error: {ex.Message}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user