public bool IsUserInBlockList(string login) { if (!BlockedUsers.ContainsKey(login)) { return(false); } DateTime expire = BlockedUsers[login]; if (expire >= DateTime.Now) { return(true); } BlockedUsers.Remove(login); return(false); }
public async Task unblock(string user) { if (!HasExecutePermission) { return; } if (Context.Message.MentionedUsers.Count == 0) { await Context.Channel.SendMessageAsync("", false, new EmbedBuilder() { Title = "who tf is that xD", Description = "you didnt mention a valid user :/", Color = Color.Red }.Build()); return; } if (BlockedUsers.Contains(Context.Message.MentionedUsers.First().Id)) { BlockedUsers.Remove(Context.Message.MentionedUsers.First().Id); Global.SaveBlockedUsers(); await Context.Channel.SendMessageAsync("", false, new EmbedBuilder() { Title = $"Succes!", Description = $"{Context.Message.MentionedUsers.First()} can make threads again", Color = Color.Green }.Build()); return; } else { await Context.Channel.SendMessageAsync("", false, new EmbedBuilder() { Title = "***wait'nt***", Description = "looks like that user isnt blocked :/", Color = Color.Green }.Build()); } }