pub struct Chatbot { /* private fields */ }
Expand description
This struct represents a chatbot that is connected to a given ship
,
is watching/posting to a specific chat_ship
/chat_name
and is using the function respond_to_message
to process any messages
which are posted in said chat.
Implementations§
Source§impl Chatbot
impl Chatbot
Sourcepub fn new(
respond_to_message: fn(AuthoredMessage) -> Option<Message>,
ship: ShipInterface,
chat_ship: &str,
chat_name: &str,
) -> Self
pub fn new( respond_to_message: fn(AuthoredMessage) -> Option<Message>, ship: ShipInterface, chat_ship: &str, chat_name: &str, ) -> Self
Create a new Chatbot
with a manually provided ShipInterface
Sourcepub fn new_with_local_config(
respond_to_message: fn(AuthoredMessage) -> Option<Message>,
chat_ship: &str,
chat_name: &str,
) -> Self
pub fn new_with_local_config( respond_to_message: fn(AuthoredMessage) -> Option<Message>, chat_ship: &str, chat_name: &str, ) -> Self
Create a new Chatbot
with a ShipInterface
derived automatically
from a local config file. If the config file does not exist, the
Chatbot
will create the config file, exit, and prompt the user to
fill it out.
Auto Trait Implementations§
impl !Freeze for Chatbot
impl !RefUnwindSafe for Chatbot
impl Send for Chatbot
impl Sync for Chatbot
impl Unpin for Chatbot
impl !UnwindSafe for Chatbot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more