public void HandleMessageDeletion(ulong MessageId, ulong GuildId) { var guild = GetGuild(GuildId); if (guild != null) { SetupMessage setupMessage; guild.SetupMessages.TryGetValue(MessageId, out setupMessage); if (setupMessage != null) { Ticket ticket; guild.Tickets.TryGetValue(setupMessage.TicketId, out ticket); if (ticket != null) { TicketManager.DeleteTicket(DiscordClient, ticket); } } } }
public static void RemoveTicket(DiscordSocketClient client, GuildEngine guild, Ticket ticket, bool clear = false) { TicketManager.DeleteTicket(client, ticket); var setmessage = GetSetupMessageByTicket(guild, ticket.Id); if (setmessage != null) { guild.SetupMessages.Remove(setmessage.MessageId); } if (clear) { return; } if (!guild.Tickets.ContainsKey(ticket.Id)) { return; } guild.Tickets.Remove(ticket.Id); }