public async Task Codes(SocketUser target = null) { var mentionedUser = Context.Message.MentionedUsers.FirstOrDefault(); target = target ?? Context.User; var user = UserAccounts.GetAccount(target); var embed = new EmbedBuilder(); embed.WithColor(Colors.Get("Iodem")); embed.WithAuthor(target); if (user.arePublicCodes || target.Equals(Context.User)) { embed.WithDescription($"PoGo: {user.PoGoCode} \n" + $"Switch: {user.SwitchCode} \n" + $"3DS: {user.N3DSCode}"); } else { embed.WithDescription(Utilities.GetAlert("CODE_IS_PRIVATE")); } await Context.Channel.SendMessageAsync("", false, embed.Build()); }
public async Task KickAsync(SocketUser user, [Remainder] string reason = "No reason specified") { await Context.Message.DeleteAsync(); if (!user.Equals(null)) { if (user.IsBot) { var msg = await Context.Channel.SendMessageAsync("I cannot kick myself... :thinking:"); await Task.Delay(4000); await msg.DeleteAsync(); return; } if (user == Context.User) { var msg = await Context.Channel.SendMessageAsync("You cannot kick yourself! :man_facepalming:"); await Task.Delay(4000); await msg.DeleteAsync(); return; } if (((IGuildUser)user).GuildPermissions.Administrator) { var msg = await Context.Channel.SendMessageAsync("HEY! You cannot kick an administrator! :point_up:"); await Task.Delay(4000); await msg.DeleteAsync(); return; } var embed = new EmbedBuilder { Author = new EmbedAuthorBuilder().WithIconUrl(Context.Client.CurrentUser.GetAvatarUrl()).WithName(Context.Client.CurrentUser.Username), Timestamp = DateTimeOffset.UtcNow, Title = "Kick", Color = Color.Blue, Fields = new List <EmbedFieldBuilder> { new EmbedFieldBuilder().WithName("Kicked user:"******"{user.Mention}"), new EmbedFieldBuilder().WithName("Kicked by:").WithValue($"{Context.Message.Author.Mention}"), new EmbedFieldBuilder().WithName("Reason:").WithValue($"{reason}") } }; await Context.Channel.SendMessageAsync(embed : embed.Build()); // TODO: Kick user logic } }
public Boolean hasPlayerJoined(SocketUser player, Object groupObj) { Group group = (Group)groupObj; ArrayList players = group.getAllPlayers(); for (int i = 0; i < players.Count; i++) { if (player.Equals(players[i])) { return(true); } } return(false); }
public async Task Codes(SocketUser target = null) { target ??= Context.User; var user = EntityConverter.ConvertUser(target); var embed = new EmbedBuilder(); embed.WithColor(Colors.Get("Iodem")); embed.WithAuthor(target); if (user.ArePublicCodes || target.Equals(Context.User)) { embed.WithDescription($"PoGo: {user.PoGoCode} \n" + $"Switch: {user.SwitchCode} \n" + $"3DS: {user.N3DsCode}"); } else { embed.WithDescription("You better ask them yourselves..."); } await Context.Channel.SendMessageAsync("", false, embed.Build()); }