From 12b265a616506923f4fc3700e83a0cbfd4703780 Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Wed, 1 Jun 2022 16:20:24 +0100 Subject: [PATCH] adjust Failure method stack --- SecondBotEvents/Services/HttpService.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/SecondBotEvents/Services/HttpService.cs b/SecondBotEvents/Services/HttpService.cs index 1a83d7a..16a1ae7 100644 --- a/SecondBotEvents/Services/HttpService.cs +++ b/SecondBotEvents/Services/HttpService.cs @@ -183,16 +183,26 @@ namespace SecondBotEvents.Services return new { reply = input, status = true }; } - protected object Failure(string input, string command, string[] args) + protected object Failure(string input, string command, string[] args, string whyfailed) { // @todo Command history storage system return new { reply = input, status = false }; } + protected object Failure(string input, string command, string[] args) + { + return Failure(input, command, args, null); + } + + + protected object Failure(string input, string[] args) + { + return Failure(input, getCallingCommand(), args, null); + } + protected object Failure(string input) { - // @todo Command history storage system - return new { reply = input, command = getCallingCommand(), status = false }; + return Failure(input, getCallingCommand(), new string[] { }, null); } protected string getCallingCommand() @@ -200,12 +210,6 @@ namespace SecondBotEvents.Services return (new System.Diagnostics.StackTrace()).GetFrame(2).GetMethod().Name; } - protected object Failure(string input, string command, string[] args, string whyfailed) - { - // @todo Command history storage system - return new { reply = input, status = false }; - } - protected object Failure(string input, string command) { return Failure(input, command, new string[] { });