[][src]Struct twitchchat::Writer

pub struct Writer(_);

A thread-safe, clonable writer for the Twitch client

Methods

impl Writer[src]

pub fn host<C>(&self, channel: C) -> Result<(), Error> where
    C: Into<Channel>, 
[src]

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]

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<S>(&self, username: S, reason: Option<&str>) -> Result<(), Error> where
    S: Display
[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<S>(&self, username: S) -> Result<(), Error> where
    S: Display
[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<S>(&self, duration: S) -> Result<(), Error> where
    S: Display
[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<S>(&self, username: S) -> Result<(), Error> where
    S: Display
[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<S>(&self, username: S) -> Result<(), Error> where
    S: Display
[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<S>(
    &self,
    username: S,
    duration: Option<&str>,
    reason: Option<&str>
) -> Result<(), Error> where
    S: Display
[src]

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<S>(&self, username: S) -> Result<(), Error> where
    S: Display
[src]

Removes a timeout on a user.

pub fn vip<S>(&self, username: S) -> Result<(), Error> where
    S: Display
[src]

Grant VIP status to a user.

Use Writer::vips to list the VIPs of this channel.

pub fn unvip<S>(&self, username: S) -> Result<(), Error> where
    S: Display
[src]

Revoke VIP status from a user.

Use Writer::vips to list the VIPs of this channel.

pub fn whisper<S>(&self, username: S, message: S) -> Result<(), Error> where
    S: Display
[src]

Whispers the message to the username.

pub fn join<C>(&self, channel: C) -> Result<(), Error> where
    C: Into<Channel>, 
[src]

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]

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: Display
[src]

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: Display
[src]

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: Display
[src]

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: Display
[src]

Sends the command: data (e.g. /color #FFFFFF)

pub fn raw<S>(&self, data: S) -> Result<(), Error> where
    S: Display
[src]

Sends a raw line (appends the required \r\n)

Trait Implementations

impl WriterExt for Writer[src]

impl Clone for Writer[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Writer

impl Sync for Writer

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]