pub struct BulkGuildBan<'a> { /* private fields */ }Expand description
Ban up to 200 users from a guild in bulk, optionally deleting their recent messages and specifying an Audit Log reason.
Requires both the BAN_MEMBERS and MANAGE_GUILD permissions.
§Examples
Ban a list of users from a guild along with the last day’s messages:
use twilight_http::{Client, request::AuditLogReason};
use twilight_model::id::{Id, marker::UserMarker};
let client = Client::new("my token".to_owned());
let guild_id = Id::new(1);
let user_ids: Vec<Id<UserMarker>> = determine_users_to_ban();
client
.bulk_guild_ban(guild_id, &user_ids)
.delete_message_seconds(86_400)
.reason("insulting my little pony")
.await?;Implementations§
Source§impl<'a> BulkGuildBan<'a>
impl<'a> BulkGuildBan<'a>
Sourcepub fn delete_message_seconds(self, seconds: u32) -> Self
pub fn delete_message_seconds(self, seconds: u32) -> Self
Set the number of seconds’ worth of messages to delete.
The number of seconds must be less than or equal to 604_800 (this is equivalent to 7 days).
Discord’s defaults this to 0 seconds.
§Errors
Returns an error of type BulkGuildBanDeleteMessageSeconds if the
number of seconds is greater than 604_800 (this is equivalent to 7 days).
Trait Implementations§
Source§impl<'a> AuditLogReason<'a> for BulkGuildBan<'a>
impl<'a> AuditLogReason<'a> for BulkGuildBan<'a>
Source§impl IntoFuture for BulkGuildBan<'_>
impl IntoFuture for BulkGuildBan<'_>
Source§type Output = Result<Response<BulkGuildBanResponseBody>, Error>
type Output = Result<Response<BulkGuildBanResponseBody>, Error>
The output that the future will produce on completion.
Source§type IntoFuture = ResponseFuture<BulkGuildBanResponseBody>
type IntoFuture = ResponseFuture<BulkGuildBanResponseBody>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Source§impl TryIntoRequest for BulkGuildBan<'_>
impl TryIntoRequest for BulkGuildBan<'_>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for BulkGuildBan<'a>
impl<'a> !UnwindSafe for BulkGuildBan<'a>
impl<'a> Freeze for BulkGuildBan<'a>
impl<'a> Send for BulkGuildBan<'a>
impl<'a> Sync for BulkGuildBan<'a>
impl<'a> Unpin for BulkGuildBan<'a>
impl<'a> UnsafeUnpin for BulkGuildBan<'a>
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