@@ -4,7 +4,7 @@ use crate::http::Http;
44use crate :: internal:: prelude:: * ;
55use crate :: model:: prelude:: * ;
66
7- /// A builder to create a [`RichInvite`] for use via [`GuildChannel ::create_invite`].
7+ /// A builder to create a [`RichInvite`] for use via [`ChannelId ::create_invite`].
88///
99/// This is a structured and cleaner way of creating an invite, as all parameters are optional.
1010///
@@ -16,9 +16,9 @@ use crate::model::prelude::*;
1616/// # use serenity::{prelude::*, model::prelude::*};
1717/// use serenity::builder::CreateInvite;
1818/// use serenity::http::Http;
19- /// # async fn run(http: &Http, channel: GuildChannel ) -> Result<(), Box<dyn std::error::Error>> {
19+ /// # async fn run(http: &Http, channel_id: ChannelId ) -> Result<(), Box<dyn std::error::Error>> {
2020/// let builder = CreateInvite::new().max_age(3600).max_uses(10);
21- /// let creation = channel .create_invite(http, builder).await?;
21+ /// let creation = channel_id .create_invite(http, builder).await?;
2222/// # Ok(())
2323/// # }
2424/// ```
@@ -57,22 +57,6 @@ impl<'a> CreateInvite<'a> {
5757 /// Set to `0` for an invite which does not expire after an amount of time.
5858 ///
5959 /// Defaults to `86400`, or 24 hours.
60- ///
61- /// # Examples
62- ///
63- /// Create an invite with a max age of `3600` seconds, or 1 hour:
64- ///
65- /// ```rust,no_run
66- /// # use serenity::model::prelude::*;
67- /// # use serenity::builder::CreateInvite;
68- /// # use serenity::http::Http;
69- /// #
70- /// # async fn example(http: &Http, channel: GuildChannel) -> Result<(), Box<dyn std::error::Error>> {
71- /// let builder = CreateInvite::new().max_age(3600);
72- /// let invite = channel.create_invite(http, builder).await?;
73- /// # Ok(())
74- /// # }
75- /// ```
7660 pub fn max_age ( mut self , max_age : u32 ) -> Self {
7761 self . max_age = Some ( max_age) ;
7862 self
@@ -83,24 +67,6 @@ impl<'a> CreateInvite<'a> {
8367 /// Set to `0` for an invite which does not expire after a number of uses.
8468 ///
8569 /// Defaults to `0`.
86- ///
87- /// # Examples
88- ///
89- /// Create an invite with a max use limit of `5`:
90- ///
91- /// Create an invite with a max age of `3600` seconds, or 1 hour:
92- ///
93- /// ```rust,no_run
94- /// # use serenity::model::prelude::*;
95- /// # use serenity::builder::CreateInvite;
96- /// # use serenity::http::Http;
97- /// #
98- /// # async fn example(http: &Http, channel: GuildChannel) -> Result<(), Box<dyn std::error::Error>> {
99- /// let builder = CreateInvite::new().max_uses(5);
100- /// let invite = channel.create_invite(http, builder).await?;
101- /// # Ok(())
102- /// # }
103- /// ```
10470 pub fn max_uses ( mut self , max_uses : u8 ) -> Self {
10571 self . max_uses = Some ( max_uses) ;
10672 self
@@ -109,22 +75,6 @@ impl<'a> CreateInvite<'a> {
10975 /// Whether an invite grants a temporary membership.
11076 ///
11177 /// Defaults to `false`.
112- ///
113- /// # Examples
114- ///
115- /// Create an invite which is temporary:
116- ///
117- /// ```rust,no_run
118- /// # use serenity::model::prelude::*;
119- /// # use serenity::builder::CreateInvite;
120- /// # use serenity::http::Http;
121- /// #
122- /// # async fn example(http: &Http, channel: GuildChannel) -> Result<(), Box<dyn std::error::Error>> {
123- /// let builder = CreateInvite::new().temporary(true);
124- /// let invite = channel.create_invite(http, builder).await?;
125- /// # Ok(())
126- /// # }
127- /// ```
12878 pub fn temporary ( mut self , temporary : bool ) -> Self {
12979 self . temporary = Some ( temporary) ;
13080 self
@@ -133,22 +83,6 @@ impl<'a> CreateInvite<'a> {
13383 /// Whether or not to try to reuse a similar invite.
13484 ///
13585 /// Defaults to `false`.
136- ///
137- /// # Examples
138- ///
139- /// Create an invite which is unique:
140- ///
141- /// ```rust,no_run
142- /// # use serenity::model::prelude::*;
143- /// # use serenity::builder::CreateInvite;
144- /// # use serenity::http::Http;
145- /// #
146- /// # async fn example(http: &Http, channel: GuildChannel) -> Result<(), Box<dyn std::error::Error>> {
147- /// let builder = CreateInvite::new().unique(true);
148- /// let invite = channel.create_invite(&http, builder).await?;
149- /// # Ok(())
150- /// # }
151- /// ```
15286 pub fn unique ( mut self , unique : bool ) -> Self {
15387 self . unique = Some ( unique) ;
15488 self
0 commit comments