pub struct TraqBot<T: Send + Sync + 'static> { /* private fields */ }Implementations§
Source§impl<T: Send + Sync + 'static> TraqBot<T>
impl<T: Send + Sync + 'static> TraqBot<T>
Sourcepub async fn start(&self) -> Result<()>
pub async fn start(&self) -> Result<()>
BOT を起動する
§Examples
use traq_ws_bot::bot::builder;
let bot = builder("BOT_ACCESS_TOKEN")
.on_message_created(|event| async move {
println!("{:?}", event);
})
.build();
bot.start().await?;
Sourcepub fn get_ws_origin(&self) -> Url
pub fn get_ws_origin(&self) -> Url
ws もしくは wss で始まる origin に相当する URL を返す
Example wss://q.trap.jp, ws://localhost:8080
Sourcepub fn get_http_origin(&self) -> Url
pub fn get_http_origin(&self) -> Url
http もしくは https で始まる origin に相当する URL を返す
Example https://q.trap.jp, http://localhost:8080
Sourcepub fn get_ws_url(&self) -> Url
pub fn get_ws_url(&self) -> Url
ws もしくは wss で始まる gateway の URL を返す
Example wss://q.trap.jp/api/v3/bot/ws
Sourcepub fn get_http_url(&self) -> Url
pub fn get_http_url(&self) -> Url
http もしくは https で始まる gateway の URL を返す
Example https://q.trap.jp/api/v3/bot/ws
Auto Trait Implementations§
impl<T> Freeze for TraqBot<T>
impl<T> !RefUnwindSafe for TraqBot<T>
impl<T> Send for TraqBot<T>
impl<T> Sync for TraqBot<T>
impl<T> Unpin for TraqBot<T>
impl<T> !UnwindSafe for TraqBot<T>
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