SteamKit2.SteamFriends.BanChatMember C# (CSharp) Method

BanChatMember() public method

Bans the specified chat member from the given chat room.
public BanChatMember ( SteamID steamIdChat, SteamID steamIdMember ) : void
steamIdChat SteamID The SteamID of chat room to ban the member from.
steamIdMember SteamID The SteamID of the member to ban from the chat.
return void
        public void BanChatMember( SteamID steamIdChat, SteamID steamIdMember )
        {
            SteamID chatId = steamIdChat.ConvertToUInt64(); // copy the steamid so we don't modify it

            var banMember = new ClientMsg<MsgClientChatAction>();

            if ( chatId.IsClanAccount )
            {
                // this steamid is incorrect, so we'll fix it up
                chatId.AccountInstance = ( uint )SteamID.ChatInstanceFlags.Clan;
                chatId.AccountType = EAccountType.Chat;
            }

            banMember.Body.SteamIdChat = chatId;
            banMember.Body.SteamIdUserToActOn = steamIdMember;

            banMember.Body.ChatAction = EChatAction.Ban;

            this.Client.Send( banMember );
        }