Class: RubyCord::Integration
- Inherits:
-
DiscordModel
- Object
- DiscordModel
- RubyCord::Integration
- Defined in:
- lib/rubycord/integration.rb
Overview
Represents a integration.
Defined Under Namespace
Classes: Account, Application
Instance Attribute Summary collapse
-
#account ⇒ RubyCord::Integration::Account
readonly
The account for the integration.
-
#application ⇒ RubyCord::Application
readonly
The application for the integration.
-
#enable_emoticons ⇒ Boolean
(also: #enable_emoticons?)
readonly
Whether the integration is enabled emoticons.
-
#enabled ⇒ Boolean
(also: #enabled?)
readonly
Whether the integration is enabled.
-
#expire_behavior ⇒ :remove_role, :kick
readonly
The behavior of the integration when it expires.
-
#expire_grace_period ⇒ Integer
readonly
The grace period of the integration.
- #guild ⇒ nil, RubyCord::Guild readonly
-
#id ⇒ RubyCord::Snowflake
readonly
The ID of the integration.
-
#revoked ⇒ Boolean
(also: #revoked?)
readonly
Whether the integration is revoked.
-
#subscriber_count ⇒ Integer
readonly
The number of subscribers for the integration.
-
#syncing ⇒ Boolean
(also: #syncing?)
readonly
Whether the integration is syncing.
-
#type ⇒ Symbol
readonly
The type of integration.
-
#user ⇒ RubyCord::User
readonly
The user for the integration.
Instance Method Summary collapse
-
#delete(reason: nil) ⇒ Async::Task<void>
(also: #destroy)
Delete the integration.
Methods inherited from DiscordModel
Instance Attribute Details
#account ⇒ RubyCord::Integration::Account (readonly)
Returns The account for the integration.
29 30 31 |
# File 'lib/rubycord/integration.rb', line 29 def account @account end |
#application ⇒ RubyCord::Application (readonly)
Returns The application for the integration.
36 37 38 |
# File 'lib/rubycord/integration.rb', line 36 def application @application end |
#enable_emoticons ⇒ Boolean (readonly) Also known as: enable_emoticons?
Returns Whether the integration is enabled emoticons.
20 21 22 |
# File 'lib/rubycord/integration.rb', line 20 def enable_emoticons @enable_emoticons end |
#enabled ⇒ Boolean (readonly) Also known as: enabled?
Returns Whether the integration is enabled.
14 15 16 |
# File 'lib/rubycord/integration.rb', line 14 def enabled @enabled end |
#expire_behavior ⇒ :remove_role, :kick (readonly)
Returns The behavior of the integration when it expires.
23 24 25 |
# File 'lib/rubycord/integration.rb', line 23 def expire_behavior @expire_behavior end |
#expire_grace_period ⇒ Integer (readonly)
Returns The grace period of the integration.
25 26 27 |
# File 'lib/rubycord/integration.rb', line 25 def expire_grace_period @expire_grace_period end |
#guild ⇒ nil, RubyCord::Guild (readonly)
This method returns an object from client cache. it will return nil
if the object is not in cache.
|
# File 'lib/rubycord/integration.rb', line 38
|
#id ⇒ RubyCord::Snowflake (readonly)
Returns The ID of the integration.
10 11 12 |
# File 'lib/rubycord/integration.rb', line 10 def id @id end |
#revoked ⇒ Boolean (readonly) Also known as: revoked?
Returns Whether the integration is revoked.
33 34 35 |
# File 'lib/rubycord/integration.rb', line 33 def revoked @revoked end |
#subscriber_count ⇒ Integer (readonly)
Returns The number of subscribers for the integration.
31 32 33 |
# File 'lib/rubycord/integration.rb', line 31 def subscriber_count @subscriber_count end |
#syncing ⇒ Boolean (readonly) Also known as: syncing?
Returns Whether the integration is syncing.
17 18 19 |
# File 'lib/rubycord/integration.rb', line 17 def syncing @syncing end |
#type ⇒ Symbol (readonly)
Returns The type of integration.
12 13 14 |
# File 'lib/rubycord/integration.rb', line 12 def type @type end |
#user ⇒ RubyCord::User (readonly)
Returns The user for the integration.
27 28 29 |
# File 'lib/rubycord/integration.rb', line 27 def user @user end |
Instance Method Details
#delete(reason: nil) ⇒ Async::Task<void> Also known as: destroy
Delete the integration.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/rubycord/integration.rb', line 73 def delete(reason: nil) Async do @client .http .request( RubyCord::Internal::Route.new( "/guilds/#{@guild}/integrations/#{@id}", "//guilds/:guild_id/integrations/:integration_id", :delete ), {}, audit_log_reason: reason ) .wait end end |