pub fn send_message(&mut self, message: &str, target: Option<String>) -> Result<(), MixerError> {
		let (arguments, method) = match target {
			Some(target) => (vec! [ target, message.to_string() ], MethodType::Whisper),
			None => (vec! [ message.to_string() ], MethodType::Msg)
		};

		let packet = ArgumentPacket {
			packet_type: PacketType::Method,
			method: method,
			arguments,
			id: self.packet_id
		};

		let packet = OwnedMessage::Text(serde_json::to_string(&packet).unwrap());
		self.send_packet(packet)?;

		Ok(())
	}
/// Send a message to the connected channel

Send a message to the connected channel
Send a message to the connected channel
pub fn send_message(&mut self, message: &str, target: Option<String>) -> Result<(), MixerError> {
		let (arguments, method) = match target {
			Some(target) => (vec! [ target, message.to_string() ], MethodType::Whisper),
			None => (vec! [ message.to_string() ], MethodType::Msg)
		};
		let packet = ArgumentPacket {
			packet_type: PacketType::Method,
			method: method,
			arguments,
			id: self.packet_id
		};
		let packet = OwnedMessage::Text(serde_json::to_string(&packet).unwrap());
		self.send_packet(packet)?;
		Ok(())
	}
pub fn send_message ( & mut self , message : & str , target : Option < String > ) -> Result < ( ) , MixerError > { let ( arguments , method ) = match target { Some ( target ) => ( vec ! [ target message to_string ( ) ] , MethodType :: Whisper ) , None => ( vec ! [ message to_string ( ) ] , MethodType :: Msg ) } ; let packet = ArgumentPacket { packet_type : PacketType :: Method , method : method , arguments , id : self . packet_id } ; let packet = OwnedMessage :: Text ( serde_json :: to_string ( & packet ) . unwrap ( ) ) ; self . send_packet ( packet ) ? ; Ok ( ( ) ) }
Send a message to the connected channel
Send a message to the connected channel
&mut self
message
&str
target
Option<String>
&mut self
message
&str
target
Option<String>