pub struct DiscordAPI {
pub client: Client,
pub base_url: Url,
pub token: String,
}Fields§
§client: Client§base_url: Url§token: StringImplementations§
Source§impl DiscordAPI
impl DiscordAPI
pub fn create(token: &str, connect_addr: &str) -> Result<DiscordAPI>
pub async fn get<T: for<'de> Deserialize<'de>>( &self, url_suffix: &str, ) -> Result<T>
pub async fn post<T: for<'de> Deserialize<'de>>( &self, url_suffix: &str, args: Value, ) -> Result<T>
pub async fn delete<T: for<'de> Deserialize<'de>>( &self, url_suffix: &str, ) -> Result<T>
pub async fn patch<T: for<'de> Deserialize<'de>>( &self, url_suffix: &str, args: Value, ) -> Result<T>
pub async fn guild(&self, id: SnowflakeID) -> Result<Guild>
pub async fn channels(&self, guild_id: SnowflakeID) -> Result<Vec<GuildChannel>>
pub async fn create_channel( &self, guild_id: SnowflakeID, channel_details: GuildChannelCreate, ) -> Result<GuildChannel>
pub async fn delete_channel( &self, channel_id: SnowflakeID, ) -> Result<GuildChannel>
pub async fn patch_channel( &self, channel_id: SnowflakeID, args: Value, ) -> Result<GuildChannel>
pub fn sanitize(source: &str) -> String
pub async fn create_message( &self, channel_id: SnowflakeID, message: MessageCreate, ) -> Result<MessageObject>
Auto Trait Implementations§
impl Freeze for DiscordAPI
impl !RefUnwindSafe for DiscordAPI
impl !Send for DiscordAPI
impl !Sync for DiscordAPI
impl Unpin for DiscordAPI
impl !UnwindSafe for DiscordAPI
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