hangman fix? closes #956
This commit is contained in:
parent
24d82d26d1
commit
11da7c89b6
@ -52,7 +52,7 @@ namespace NadekoBot.Modules.Games.Commands.Hangman
|
||||
}
|
||||
}
|
||||
|
||||
public class HangmanGame
|
||||
public class HangmanGame: IDisposable
|
||||
{
|
||||
private readonly Logger _log;
|
||||
|
||||
@ -196,5 +196,11 @@ namespace NadekoBot.Modules.Games.Commands.Hangman
|
||||
{(Errors > 1 ? "/" : " ")} {(Errors > 2 ? "|" : " ")} {(Errors > 3 ? "\\" : " ")} |
|
||||
{(Errors > 4 ? "/" : " ")} {(Errors > 5 ? "\\" : " ")} |
|
||||
/-\";
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
NadekoBot.Client.MessageReceived -= PotentialGuess;
|
||||
OnEnded = null;
|
||||
}
|
||||
}
|
||||
}
|
@ -52,8 +52,12 @@ namespace NadekoBot.Modules.Games
|
||||
{
|
||||
hm.Start();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
catch (Exception ex)
|
||||
{
|
||||
try { await Context.Channel.SendErrorAsync($"Starting errored: {ex.Message}").ConfigureAwait(false); } catch { }
|
||||
HangmanGame throwaway;
|
||||
HangmanGames.TryRemove(Context.Channel.Id, out throwaway);
|
||||
throwaway.Dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user