protected static bool checkVerification(ICommandContext Context) { IChannel chnl = Context.Channel; IUser usr = Context.User; GameObj gm = findGame(usr); if (gm == null) { return(false); } if (gm.getChannel().Equals(chnl) && usr.Equals(gm.getDm())) { return(true); } return(false); }
public async Task endGame() { bool verification = checkVerification(Context); if (verification) { ITextChannel chnl = await Context.Guild.GetTextChannelAsync(481285807651553290); await chnl.SendMessageAsync("**Game Deletion**\nDM: " + Context.User.Mention + "\nChannel: " + Context.Channel + "\nTime: " + DateTime.Now.TimeOfDay.ToString().Substring(0, 8)); GameObj game1 = findGame(Context.Channel); games.Remove(game1); await Context.Guild.GetUserAsync(Context.User.Id).Result.RemoveRoleAsync(dmRole); await Context.Channel.SendMessageAsync("The game has been deleted. Thank you for playing!"); } else { await notVerified(); } }