[−][src]Struct twitchchat::Writer
A thread-safe, clonable writer for the Twitch client
Methods
impl<W: Write> Writer<W>
[src]
pub fn host<C>(&self, channel: C) -> Result<(), Error> where
C: Into<Channel>,
[src]
C: Into<Channel>,
Host another channel.
Use Writer::unhost
to unset host mode.
pub fn unhost(&self) -> Result<(), Error>
[src]
Stop hosting another channel.
pub fn marker(&self, comment: Option<&str>) -> Result<(), Error>
[src]
Adds a stream marker (with an optional comment, max 140 characters) at the current timestamp.
You can use markers in the Highlighter for easier editing.
pub fn raid<C>(&self, channel: C) -> Result<(), Error> where
C: Into<Channel>,
[src]
C: Into<Channel>,
Raid another channel.
Use Writer::unraid
to cancel the Raid.
pub fn unraid(&self) -> Result<(), Error>
[src]
Cancel the Raid.
pub fn color(&self, color: Color) -> Result<(), Error>
[src]
Change your username color.
pub fn disconnect(&self) -> Result<(), Error>
[src]
Reconnects to chat.
pub fn help(&self) -> Result<(), Error>
[src]
Lists the commands available to you in this room.
pub fn mods(&self) -> Result<(), Error>
[src]
Lists the moderators of this channel.
pub fn vips(&self) -> Result<(), Error>
[src]
Lists the VIPs of this channel.
pub fn commercial(&self, length: Option<usize>) -> Result<(), Error>
[src]
Triggers a commercial.
Length (optional) must be a positive number of seconds.
pub fn ban(&self, username: &str, reason: Option<&str>) -> Result<(), Error>
[src]
Permanently prevent a user from chatting. Reason is optional and will be shown to the target user and other moderators.
Use Writer::unban
to remove a ban.
pub fn unban(&self, username: &str) -> Result<(), Error>
[src]
Removes a ban on a user.
pub fn clear(&self) -> Result<(), Error>
[src]
Clear chat history for all users in this room.
pub fn emoteonly(&self) -> Result<(), Error>
[src]
Enables emote-only mode (only emoticons may be used in chat).
Use Writer::emoteonlyoff
to disable.
pub fn emoteonlyoff(&self) -> Result<(), Error>
[src]
Disables emote-only mode.
pub fn followers(&self, duration: &str) -> Result<(), Error>
[src]
Enables followers-only mode (only users who have followed for 'duration' may chat).
Examples: "30m", "1 week", "5 days 12 hours".
Must be less than 3 months.
pub fn followersoff(&self) -> Result<(), Error>
[src]
Disables followers-only mode.
pub fn op(&self, username: &str) -> Result<(), Error>
[src]
Grant moderator status to a user.
Use Writer::mods
to list the moderators of this channel.
(NOTE: renamed to op
because r#mod is annoying to type)
pub fn unmod(&self, username: &str) -> Result<(), Error>
[src]
Revoke moderator status from a user.
Use Writer::mods
to list the moderators of this channel.
pub fn r9kbeta(&self) -> Result<(), Error>
[src]
Enables r9k mode.
Use Writer::r9kbetaoff
to disable.
pub fn r9kbetaoff(&self) -> Result<(), Error>
[src]
Disables r9k mode.
pub fn slow(&self, duration: Option<usize>) -> Result<(), Error>
[src]
Enables slow mode (limit how often users may send messages).
Duration (optional, default=120) must be a positive number of seconds.
Use Writer::slowoff
to disable.
pub fn slowoff(&self) -> Result<(), Error>
[src]
Disables slow mode.
pub fn subscribers(&self) -> Result<(), Error>
[src]
Enables subscribers-only mode (only subscribers may chat in this channel).
Use Writer::subscribersoff
to disable.
pub fn subscribersoff(&self) -> Result<(), Error>
[src]
Disables subscribers-only mode.
pub fn timeout(
&self,
username: &str,
duration: Option<&str>,
reason: Option<&str>
) -> Result<(), Error>
[src]
&self,
username: &str,
duration: Option<&str>,
reason: Option<&str>
) -> Result<(), Error>
Temporarily prevent a user from chatting.
- duration (optional, default=
10 minutes
) must be a positive integer. - time unit (optional, default=
s
) must be one of- s
- m
- h
- d
- w
- maximum duration is
2 weeks
.
Combinations like 1d2h
are also allowed.
Reason is optional and will be shown to the target user and other moderators.
Use Writer::untimeout
to remove a timeout.
pub fn untimeout(&self, username: &str) -> Result<(), Error>
[src]
Removes a timeout on a user.
pub fn vip(&self, username: &str) -> Result<(), Error>
[src]
Grant VIP status to a user.
Use Writer::vips
to list the VIPs of this channel.
pub fn unvip(&self, username: &str) -> Result<(), Error>
[src]
Revoke VIP status from a user.
Use Writer::vips
to list the VIPs of this channel.
pub fn whisper(&self, username: &str, message: &str) -> Result<(), Error>
[src]
Whispers the message to the username.
pub fn join<C>(&self, channel: C) -> Result<(), Error> where
C: Into<Channel>,
[src]
C: Into<Channel>,
Joins a channel
This ensures the channel name is lowercased and begins with a '#'.
The following are equivilant
let w = client.writer(); w.join("museun").unwrap(); w.join("#museun").unwrap(); w.join("Museun").unwrap(); w.join("#MUSEUN").unwrap();
pub fn part<C>(&self, channel: C) -> Result<(), Error> where
C: Into<Channel>,
[src]
C: Into<Channel>,
Parts a channel
This ensures the channel name is lowercased and begins with a '#'.
The following are equivilant
let w = client.writer(); w.part("museun").unwrap(); w.part("#museun").unwrap(); w.part("Museun").unwrap(); w.part("#MUSEUN").unwrap();
pub fn me<C, S>(&self, channel: C, message: S) -> Result<(), Error> where
C: Into<Channel>,
S: AsRef<str>,
[src]
C: Into<Channel>,
S: AsRef<str>,
Sends an "emote" message
in the third person to the channel
This ensures the channel name is lowercased and begins with a '#'.
pub fn privmsg<C, S>(&self, channel: C, message: S) -> Result<(), Error> where
C: Into<Channel>,
S: AsRef<str>,
[src]
C: Into<Channel>,
S: AsRef<str>,
Sends the message
to the channel
This ensures the channel name is lowercased and begins with a '#'.
Same as send
pub fn send<C, S>(&self, channel: C, message: S) -> Result<(), Error> where
C: Into<Channel>,
S: AsRef<str>,
[src]
C: Into<Channel>,
S: AsRef<str>,
Sends the message
to the channel
This ensures the channel name is lowercased and begins with a '#'.
Same as privmsg
pub fn command<S>(&self, data: S) -> Result<(), Error> where
S: AsRef<str>,
[src]
S: AsRef<str>,
Sends the command: data
(e.g. /color #FFFFFF
)
pub fn raw<S>(&self, data: S) -> Result<(), Error> where
S: AsRef<str>,
[src]
S: AsRef<str>,
Sends a raw line (appends the required \r\n
)
Trait Implementations
impl<W: Write> WriterExt for Writer<W>
[src]
fn join_many_limited<'a, I, S>(
&self,
channels: I,
rate: Option<RateLimit>
) -> Result<(), Error> where
I: IntoIterator<Item = S> + 'a,
S: AsRef<str> + 'a,
[src]
&self,
channels: I,
rate: Option<RateLimit>
) -> Result<(), Error> where
I: IntoIterator<Item = S> + 'a,
S: AsRef<str> + 'a,
fn join_many<'a, I, S>(&self, channels: I) -> Result<(), Error> where
I: IntoIterator<Item = S> + 'a,
S: AsRef<str> + 'a,
[src]
I: IntoIterator<Item = S> + 'a,
S: AsRef<str> + 'a,
impl<W> Clone for Writer<W>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,