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