#[non_exhaustive]pub struct DeleteChatMessagesRequest<'a> {
pub broadcaster_id: Cow<'a, UserIdRef>,
pub moderator_id: Cow<'a, UserIdRef>,
pub message_id: Option<Cow<'a, MsgIdRef>>,
}
helix
only.Expand description
Query Parameters for Delete Chat Messages
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.broadcaster_id: Cow<'a, UserIdRef>
The ID of the broadcaster that owns the chat room to remove messages from.
moderator_id: Cow<'a, UserIdRef>
The ID of a user that has permission to moderate the broadcaster’s chat room.
This ID must match the user ID in the OAuth token. If the broadcaster wants to remove messages themselves, set this parameter to the broadcaster’s ID, too.
message_id: Option<Cow<'a, MsgIdRef>>
The ID of the message to remove.
The id tag in the PRIVMSG contains the message’s ID (see PRIVMSG Tags).
Restrictions
The message must have been created within the last 6 hours. The message must not belong to the broadcaster. The message must not belong to another moderator.
If not specified, the request removes all messages in the broadcaster’s chat room.
Implementations
sourceimpl<'a> DeleteChatMessagesRequest<'a>
impl<'a> DeleteChatMessagesRequest<'a>
sourcepub fn builder() -> DeleteChatMessagesRequestBuilder<'a, ((), (), ())>
pub fn builder() -> DeleteChatMessagesRequestBuilder<'a, ((), (), ())>
Create a builder for building DeleteChatMessagesRequest
.
On the builder, call .broadcaster_id(...)
, .moderator_id(...)
, .message_id(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of DeleteChatMessagesRequest
.
sourceimpl<'a> DeleteChatMessagesRequest<'a>
impl<'a> DeleteChatMessagesRequest<'a>
sourcepub fn new(
broadcaster_id: impl IntoCow<'a, UserIdRef> + 'a,
moderator_id: impl IntoCow<'a, UserIdRef> + 'a
) -> Self
pub fn new(
broadcaster_id: impl IntoCow<'a, UserIdRef> + 'a,
moderator_id: impl IntoCow<'a, UserIdRef> + 'a
) -> Self
Remove chat message(s)
Examples found in repository?
673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700
pub async fn delete_chat_message<'b, T>(
&'a self,
broadcaster_id: impl types::IntoCow<'b, types::UserIdRef> + 'b,
moderator_id: impl types::IntoCow<'b, types::UserIdRef> + 'b,
message_id: impl types::IntoCow<'b, types::MsgIdRef> + 'b,
token: &T,
) -> Result<helix::moderation::DeleteChatMessagesResponse, ClientError<'a, C>>
where
T: TwitchToken + ?Sized,
{
let req = helix::moderation::DeleteChatMessagesRequest::new(broadcaster_id, moderator_id)
.message_id(message_id);
Ok(self.req_delete(req, token).await?.data)
}
/// Delete all chat messages in a broadcasters chat room
pub async fn delete_all_chat_message<'b, T>(
&'a self,
broadcaster_id: impl types::IntoCow<'b, types::UserIdRef> + 'b,
moderator_id: impl types::IntoCow<'b, types::UserIdRef> + 'b,
token: &T,
) -> Result<helix::moderation::DeleteChatMessagesResponse, ClientError<'a, C>>
where
T: TwitchToken + ?Sized,
{
let req = helix::moderation::DeleteChatMessagesRequest::new(broadcaster_id, moderator_id);
Ok(self.req_delete(req, token).await?.data)
}
sourcepub fn message_id(self, message_id: impl IntoCow<'a, MsgIdRef> + 'a) -> Self
pub fn message_id(self, message_id: impl IntoCow<'a, MsgIdRef> + 'a) -> Self
A specific message to remove
Examples found in repository?
673 674 675 676 677 678 679 680 681 682 683 684 685 686
pub async fn delete_chat_message<'b, T>(
&'a self,
broadcaster_id: impl types::IntoCow<'b, types::UserIdRef> + 'b,
moderator_id: impl types::IntoCow<'b, types::UserIdRef> + 'b,
message_id: impl types::IntoCow<'b, types::MsgIdRef> + 'b,
token: &T,
) -> Result<helix::moderation::DeleteChatMessagesResponse, ClientError<'a, C>>
where
T: TwitchToken + ?Sized,
{
let req = helix::moderation::DeleteChatMessagesRequest::new(broadcaster_id, moderator_id)
.message_id(message_id);
Ok(self.req_delete(req, token).await?.data)
}
Trait Implementations
sourceimpl<'a> Clone for DeleteChatMessagesRequest<'a>
impl<'a> Clone for DeleteChatMessagesRequest<'a>
sourcefn clone(&self) -> DeleteChatMessagesRequest<'a>
fn clone(&self) -> DeleteChatMessagesRequest<'a>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<'a> Debug for DeleteChatMessagesRequest<'a>
impl<'a> Debug for DeleteChatMessagesRequest<'a>
sourceimpl<'de: 'a, 'a> Deserialize<'de> for DeleteChatMessagesRequest<'a>
impl<'de: 'a, 'a> Deserialize<'de> for DeleteChatMessagesRequest<'a>
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
sourceimpl<'a> PartialEq<DeleteChatMessagesRequest<'a>> for DeleteChatMessagesRequest<'a>
impl<'a> PartialEq<DeleteChatMessagesRequest<'a>> for DeleteChatMessagesRequest<'a>
sourcefn eq(&self, other: &DeleteChatMessagesRequest<'a>) -> bool
fn eq(&self, other: &DeleteChatMessagesRequest<'a>) -> bool
sourceimpl Request for DeleteChatMessagesRequest<'_>
impl Request for DeleteChatMessagesRequest<'_>
type Response = DeleteChatMessagesResponse
type Response = DeleteChatMessagesResponse
sourceconst OPT_SCOPE: &'static [Scope] = _
const OPT_SCOPE: &'static [Scope] = _
twitch_oauth2
only.sourceconst PATH: &'static str = "moderation/chat"
const PATH: &'static str = "moderation/chat"
channels
for Get Channel Informationsourceconst SCOPE: &'static [Scope] = _
const SCOPE: &'static [Scope] = _
twitch_oauth2
only.sourcefn query(&self) -> Result<String, SerializeError>
fn query(&self) -> Result<String, SerializeError>
sourcefn get_uri(&self) -> Result<Uri, InvalidUri>
fn get_uri(&self) -> Result<Uri, InvalidUri>
sourcefn get_bare_uri() -> Result<Uri, InvalidUri>
fn get_bare_uri() -> Result<Uri, InvalidUri>
sourceimpl RequestDelete for DeleteChatMessagesRequest<'_>
impl RequestDelete for DeleteChatMessagesRequest<'_>
sourcefn parse_inner_response(
request: Option<Self>,
uri: &Uri,
response: &str,
status: StatusCode
) -> Result<Response<Self, Self::Response>, HelixRequestDeleteError>where
Self: Sized,
fn parse_inner_response(
request: Option<Self>,
uri: &Uri,
response: &str,
status: StatusCode
) -> Result<Response<Self, Self::Response>, HelixRequestDeleteError>where
Self: Sized,
sourcefn create_request(
&self,
token: &str,
client_id: &str
) -> Result<Request<Bytes>, CreateRequestError>
fn create_request(
&self,
token: &str,
client_id: &str
) -> Result<Request<Bytes>, CreateRequestError>
http::Request
from this Request
in your clientsourceimpl<'a> Serialize for DeleteChatMessagesRequest<'a>
impl<'a> Serialize for DeleteChatMessagesRequest<'a>
impl<'a> Eq for DeleteChatMessagesRequest<'a>
impl<'a> StructuralEq for DeleteChatMessagesRequest<'a>
impl<'a> StructuralPartialEq for DeleteChatMessagesRequest<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for DeleteChatMessagesRequest<'a>
impl<'a> Send for DeleteChatMessagesRequest<'a>
impl<'a> Sync for DeleteChatMessagesRequest<'a>
impl<'a> Unpin for DeleteChatMessagesRequest<'a>
impl<'a> UnwindSafe for DeleteChatMessagesRequest<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.