Class: Discorb::VoiceState

Inherits:
DiscordModel show all
Defined in:
lib/discorb/voice_state.rb

Overview

Represents a state of user in voice channel.

Instance Attribute Summary collapse

Method Summary

Methods inherited from DiscordModel

#==, #eql?, #inspect

Instance Attribute Details

#channelnil, Discorb::Channel (readonly)

Note:

This method returns an object from client cache. it will return nil if the object is not in cache.

Returns:

  • (nil)

    The object wasn't cached.

  • (Discorb::Channel)

    The channel this voice state is for.



# File 'lib/discorb/voice_state.rb', line 31

#deaf?Boolean (readonly)

Returns Whether the user is deafened.

Returns:

  • (Boolean)

    Whether the user is deafened.



# File 'lib/discorb/voice_state.rb', line 31

#guildnil, Discorb::Guild (readonly)

Note:

This method returns an object from client cache. it will return nil if the object is not in cache.

Returns:

  • (nil)

    The object wasn't cached.

  • (Discorb::Guild)

    The guild this voice state is for.



# File 'lib/discorb/voice_state.rb', line 31

#memberDiscorb::Member (readonly)

Returns The member associated with this voice state.

Returns:



9
10
11
# File 'lib/discorb/voice_state.rb', line 9

def member
  @member
end

#mute?Boolean (readonly)

Returns Whether the user is muted.

Returns:

  • (Boolean)

    Whether the user is muted.



# File 'lib/discorb/voice_state.rb', line 31

#request_to_speak_timestampTime (readonly)

Returns The time at which the user requested to speak.

Returns:

  • (Time)

    The time at which the user requested to speak.



13
14
15
# File 'lib/discorb/voice_state.rb', line 13

def request_to_speak_timestamp
  @request_to_speak_timestamp
end

#self_deafBoolean (readonly) Also known as: self_deaf?

Returns Whether the user is deafened.

Returns:

  • (Boolean)

    Whether the user is deafened.



15
16
17
# File 'lib/discorb/voice_state.rb', line 15

def self_deaf
  @self_deaf
end

#self_muteBoolean (readonly) Also known as: self_mute?

Returns Whether the user is muted.

Returns:

  • (Boolean)

    Whether the user is muted.



18
19
20
# File 'lib/discorb/voice_state.rb', line 18

def self_mute
  @self_mute
end

#self_streamBoolean (readonly) Also known as: stream?

Returns Whether the user is streaming.

Returns:

  • (Boolean)

    Whether the user is streaming.



21
22
23
# File 'lib/discorb/voice_state.rb', line 21

def self_stream
  @self_stream
end

#self_videoBoolean (readonly) Also known as: video?

Returns Whether the user is video-enabled.

Returns:

  • (Boolean)

    Whether the user is video-enabled.



25
26
27
# File 'lib/discorb/voice_state.rb', line 25

def self_video
  @self_video
end

#server_deaf?Boolean (readonly)

Returns Whether the user is deafened on the server.

Returns:

  • (Boolean)

    Whether the user is deafened on the server.



# File 'lib/discorb/voice_state.rb', line 31

#server_mute?Boolean (readonly)

Returns Whether the user is muted on the server.

Returns:

  • (Boolean)

    Whether the user is muted on the server.



# File 'lib/discorb/voice_state.rb', line 31

#session_idDiscorb::Snowflake (readonly)

Returns The ID of the guild this voice state is for.

Returns:



11
12
13
# File 'lib/discorb/voice_state.rb', line 11

def session_id
  @session_id
end

#suppressBoolean (readonly) Also known as: suppress?

Returns Whether the user is suppressed. (Is at audience).

Returns:

  • (Boolean)

    Whether the user is suppressed. (Is at audience)



28
29
30
# File 'lib/discorb/voice_state.rb', line 28

def suppress
  @suppress
end

#usernil, Discorb::User (readonly)

Note:

This method returns an object from client cache. it will return nil if the object is not in cache.

Returns:

  • (nil)

    The object wasn't cached.

  • (Discorb::User)

    The user this voice state is for.



# File 'lib/discorb/voice_state.rb', line 31