pub fn new_cmd(&self,
                   cmd: &str)
                   -> impl Stream<Item = (RcBot, objects::Message), Error = Error> {
        let (sender, receiver) = mpsc::unbounded();

        self.inner.handlers.borrow_mut().insert(cmd.into(), sender);

        receiver.map_err(|_| Error::Unknown)
    }
/// Creates a new command and returns a stream which
/// will yield a message when the command is send
Creates a new command and returns a stream which
will yield a message when the command is send
Creates a new command and returns a stream which will yield a message when the command is send
pub fn new_cmd(&self,
                   cmd: &str)
                   -> impl Stream<Item = (RcBot, objects::Message), Error = Error> {
        let (sender, receiver) = mpsc::unbounded();
        self.inner.handlers.borrow_mut().insert(cmd.into(), sender);
        receiver.map_err(|_| Error::Unknown)
    }
pub fn new_cmd ( & self , cmd : & str ) -> impl Stream < Item = ( RcBot , objects :: Message ) , Error = Error > { let ( sender , receiver ) = mpsc :: unbounded ( ) ; self . inner . handlers . borrow_mut ( ) . insert ( cmd . into ( ) , sender ) ; receiver . map_err ( | _ | Error :: Unknown ) }
Creates a new command and returns a stream which
will yield a message when the command is send
Creates a new command and returns a stream which will yield a message when the command is send
&self
cmd
&str