protected async Task Kill(MafiaPlayer player, DeathReason reason) { Players.Remove(player); Killed.Add(player); await GetGuild().GetUser(player.GetId()).AddRoleAsync(GetDeadRole()); await ChannelVisibility(GetGeneral(), Killed, x => false, true); await ChannelVisibility(GetDead(), Killed, x => true); await VoiceMute(Killed, false); if (IsMafia(player)) { await ChannelVisibility(GetMafia(), new List <MafiaPlayer> { player }, false, true); } var dm = await player.GetDm(); await dm.SendMessageAsync("", false, new EmbedBuilder() .WithColor(Color.Red) .WithTitle("You are dead.") .WithDescription(DeathDescription(reason)) .Build()); }
private string GetName(MafiaPlayer player) { var user = GetGuild().GetUser(player.GetId()); return(user.Nickname ?? user.Username); }