Class: DiscordRDA::Guild

Inherits:
Entity
  • Object
show all
Defined in:
lib/discord_rda/entity/guild.rb

Overview

Represents a Discord guild (server).

Class Attribute Summary collapse

Attributes inherited from Entity

#id

Instance Method Summary collapse

Methods inherited from Entity

#==, attribute, #created_at, from_hash, #hash, #initialize, #inspect, #to_h, #to_json

Constructor Details

This class inherits a constructor from DiscordRDA::Entity

Class Attribute Details

.apiObject

Returns the value of attribute api.



279
280
281
# File 'lib/discord_rda/entity/guild.rb', line 279

def api
  @api
end

Instance Method Details

#animated_banner?Boolean

Check if guild has animated banner

Returns:

  • (Boolean)

    True if animated banner feature enabled



216
217
218
# File 'lib/discord_rda/entity/guild.rb', line 216

def animated_banner?
  feature?(:animated_banner)
end

#animated_icon?Boolean

Check if guild has animated icon

Returns:

  • (Boolean)

    True if animated icon feature enabled



222
223
224
# File 'lib/discord_rda/entity/guild.rb', line 222

def animated_icon?
  feature?(:animated_icon)
end

#approximate_member_countInteger?

Get approximate member count

Returns:

  • (Integer, nil)

    Approximate member count from preview



152
153
154
# File 'lib/discord_rda/entity/guild.rb', line 152

def approximate_member_count
  @raw_data['approximate_member_count']
end

#approximate_presence_countInteger?

Get approximate presence count

Returns:

  • (Integer, nil)

    Approximate online members



158
159
160
# File 'lib/discord_rda/entity/guild.rb', line 158

def approximate_presence_count
  @raw_data['approximate_presence_count']
end

#available?Boolean

Check if guild is available (not unavailable due to outage)

Returns:

  • (Boolean)

    True if available



267
268
269
# File 'lib/discord_rda/entity/guild.rb', line 267

def available?
  !@raw_data['unavailable']
end

Check if guild has banner feature

Returns:

  • (Boolean)

    True if banner feature enabled



204
205
206
# File 'lib/discord_rda/entity/guild.rb', line 204

def banner_feature?
  feature?(:banner)
end

#boost_countInteger

Get number of boosts

Returns:

  • (Integer)

    Boost count



234
235
236
# File 'lib/discord_rda/entity/guild.rb', line 234

def boost_count
  premium_subscription_count
end

#boost_progress_bar?Boolean

Check if boost progress bar is enabled

Returns:

  • (Boolean)

    True if enabled



240
241
242
# File 'lib/discord_rda/entity/guild.rb', line 240

def boost_progress_bar?
  premium_progress_bar_enabled
end

#boost_tierString

Get boost count as tier name

Returns:

  • (String)

    Boost tier



228
229
230
# File 'lib/discord_rda/entity/guild.rb', line 228

def boost_tier
  premium_tier_name
end

#community?Boolean

Check if community guild

Returns:

  • (Boolean)

    True if community feature enabled



134
135
136
# File 'lib/discord_rda/entity/guild.rb', line 134

def community?
  feature?(:community)
end

#create_sticker(name:, description:, tags:, file:, reason: nil) ⇒ Sticker

Create a guild sticker

Parameters:

  • name (String)

    Sticker name (2-30 characters)

  • description (String)

    Sticker description (2-100 characters, optional for guild stickers)

  • tags (String)

    Sticker tags (comma-separated, 2-200 characters total)

  • file (File, String, IO)

    Sticker file (PNG, APNG, Lottie, or GIF, max 512KB, 320x320)

  • reason (String) (defaults to: nil)

    Audit log reason

Returns:



426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'lib/discord_rda/entity/guild.rb', line 426

def create_sticker(name:, description:, tags:, file:, reason: nil)
  return nil unless self.class.api

  headers = {}
  headers['X-Audit-Log-Reason'] = CGI.escape(reason) if reason

  # Determine content type based on file extension
  file_path = file.respond_to?(:path) ? file.path : file.to_s
  ext = File.extname(file_path).downcase

  content_type = case ext
                 when '.png' then 'image/png'
                 when '.apng' then 'image/apng'
                 when '.gif' then 'image/gif'
                 when '.json' then 'application/json'
                 else 'application/octet-stream'
                 end

  # Create a file wrapper with proper metadata
  file_wrapper = if file.respond_to?(:read)
                   file
                 else
                   File.open(file, 'rb')
                 end

  # Set content type if not already set
  unless file_wrapper.respond_to?(:content_type)
    def file_wrapper.content_type
      @content_type ||= 'application/octet-stream'
    end
    file_wrapper.instance_variable_set(:@content_type, content_type)
  end

  unless file_wrapper.respond_to?(:original_filename)
    def file_wrapper.original_filename
      @original_filename ||= 'sticker.png'
    end
    file_wrapper.instance_variable_set(:@original_filename, File.basename(file_path))
  end

  payload = {
    name: name,
    description: description,
    tags: tags
  }

  data = self.class.api.post(
    "/guilds/#{id}/stickers",
    body: payload,
    files: { 'file' => file_wrapper },
    headers: headers
  )

  Sticker.new(data)
ensure
  file_wrapper.close if file_wrapper.respond_to?(:close) && !file_wrapper.closed? && file_wrapper != file
end

#default_message_notifications_nameString

Get default message notifications setting name

Returns:

  • (String)

    Notification setting



104
105
106
# File 'lib/discord_rda/entity/guild.rb', line 104

def default_message_notifications_name
  %w[all_messages only_mentions][default_message_notifications] || 'unknown'
end

#delete_sticker(sticker_id, reason: nil) ⇒ void

This method returns an undefined value.

Delete a guild sticker

Parameters:

  • sticker_id (String, Snowflake)

    Sticker ID

  • reason (String) (defaults to: nil)

    Audit log reason



507
508
509
510
511
512
513
514
# File 'lib/discord_rda/entity/guild.rb', line 507

def delete_sticker(sticker_id, reason: nil)
  return unless self.class.api

  headers = {}
  headers['X-Audit-Log-Reason'] = CGI.escape(reason) if reason

  self.class.api.delete("/guilds/#{id}/stickers/#{sticker_id}", headers: headers)
end

#discovery_splash_url(format: 'png', size: nil) ⇒ String?

Get discovery splash URL

Parameters:

  • format (String) (defaults to: 'png')

    Image format

  • size (Integer) (defaults to: nil)

    Image size

Returns:

  • (String, nil)

    Discovery splash URL or nil



194
195
196
197
198
199
200
# File 'lib/discord_rda/entity/guild.rb', line 194

def discovery_splash_url(format: 'png', size: nil)
  return nil unless @raw_data['discovery_splash']

  url = "https://cdn.discordapp.com/discovery-splashes/#{id}/#{@raw_data['discovery_splash']}.#{format}"
  url += "?size=#{size}" if size
  url
end

#emoji_countInteger

Get emoji count

Returns:

  • (Integer)

    Number of emojis



560
561
562
# File 'lib/discord_rda/entity/guild.rb', line 560

def emoji_count
  @raw_data['emojis']&.length || 0
end

#emoji_objectsArray<Emoji>

Get Emoji objects from raw data

Returns:

  • (Array<Emoji>)

    Guild emojis



186
187
188
# File 'lib/discord_rda/entity/guild.rb', line 186

def emoji_objects
  (@raw_data['emojis'] || []).map { |e| Emoji.new(e) }
end

#explicit_content_filter_nameString

Get explicit content filter name

Returns:

  • (String)

    Content filter setting



110
111
112
# File 'lib/discord_rda/entity/guild.rb', line 110

def explicit_content_filter_name
  %w[disabled_members_without_roles all_members][explicit_content_filter] || 'unknown'
end

#feature?(feature) ⇒ Boolean

Check if guild has a specific feature

Parameters:

  • feature (String, Symbol)

    Feature name

Returns:

  • (Boolean)

    True if feature is enabled



74
75
76
# File 'lib/discord_rda/entity/guild.rb', line 74

def feature?(feature)
  features.include?(feature.to_s.upcase)
end

#featuresArray<String>

Get available features

Returns:

  • (Array<String>)

    Enabled features



80
81
82
# File 'lib/discord_rda/entity/guild.rb', line 80

def features
  @raw_data['features'] || []
end

#fetch_bans(limit: 100) ⇒ Array<Hash>

Fetch bans in this guild

Parameters:

  • limit (Integer) (defaults to: 100)

    Max bans (1-1000)

Returns:

  • (Array<Hash>)

    Bans with user and reason



329
330
331
332
333
334
# File 'lib/discord_rda/entity/guild.rb', line 329

def fetch_bans(limit: 100)
  return [] unless self.class.api

  data = self.class.api.get("/guilds/#{id}/bans", params: { limit: limit })
  data.map { |b| { user: User.new(b['user']), reason: b['reason'] } }
end

#fetch_channelsArray<Channel>

Fetch channels in this guild

Returns:

  • (Array<Channel>)

    Guild channels



310
311
312
313
314
315
# File 'lib/discord_rda/entity/guild.rb', line 310

def fetch_channels
  return [] unless self.class.api

  data = self.class.api.get("/guilds/#{id}/channels")
  data.map { |c| Channel.new(c) }
end

#fetch_integrationsArray<Hash>

Fetch integrations for this guild

Returns:

  • (Array<Hash>)

    Guild integrations



392
393
394
395
396
# File 'lib/discord_rda/entity/guild.rb', line 392

def fetch_integrations
  return [] unless self.class.api

  self.class.api.get("/guilds/#{id}/integrations")
end

#fetch_invitesArray<Hash>

Fetch active invites for this guild

Returns:

  • (Array<Hash>)

    Guild invites



338
339
340
341
342
# File 'lib/discord_rda/entity/guild.rb', line 338

def fetch_invites
  return [] unless self.class.api

  self.class.api.get("/guilds/#{id}/invites")
end

#fetch_member(user_id) ⇒ Member?

Fetch a member from this guild

Parameters:

Returns:

  • (Member, nil)

    Member or nil if not found



285
286
287
288
289
290
291
292
# File 'lib/discord_rda/entity/guild.rb', line 285

def fetch_member(user_id)
  return nil unless self.class.api

  data = self.class.api.get("/guilds/#{id}/members/#{user_id}")
  Member.new(data.merge('guild_id' => id.to_s))
rescue RestClient::NotFoundError
  nil
end

#fetch_members(limit: 100, after: nil) ⇒ Array<Member>

Fetch members from this guild (simplified pagination)

Parameters:

  • limit (Integer) (defaults to: 100)

    Max members (1-1000)

  • after (String, Snowflake) (defaults to: nil)

    Get members after this user ID

Returns:

  • (Array<Member>)

    Guild members



298
299
300
301
302
303
304
305
306
# File 'lib/discord_rda/entity/guild.rb', line 298

def fetch_members(limit: 100, after: nil)
  return [] unless self.class.api

  params = { limit: limit }
  params[:after] = after.to_s if after

  data = self.class.api.get("/guilds/#{id}/members", params: params)
  data.map { |m| Member.new(m.merge('guild_id' => id.to_s)) }
end

#fetch_onboardingHash?

Fetch onboarding settings

Returns:

  • (Hash, nil)

    Onboarding data



366
367
368
369
370
371
372
# File 'lib/discord_rda/entity/guild.rb', line 366

def fetch_onboarding
  return nil unless self.class.api

  self.class.api.get("/guilds/#{id}/onboarding")
rescue RestClient::NotFoundError
  nil
end

#fetch_previewHash?

Fetch guild preview (for lurkable guilds)

Returns:

  • (Hash, nil)

    Guild preview data



346
347
348
349
350
351
352
# File 'lib/discord_rda/entity/guild.rb', line 346

def fetch_preview
  return nil unless self.class.api

  self.class.api.get("/guilds/#{id}/preview")
rescue RestClient::NotFoundError
  nil
end

#fetch_rolesArray<Role>

Fetch roles in this guild

Returns:

  • (Array<Role>)

    Guild roles



319
320
321
322
323
324
# File 'lib/discord_rda/entity/guild.rb', line 319

def fetch_roles
  return [] unless self.class.api

  data = self.class.api.get("/guilds/#{id}/roles")
  data.map { |r| Role.new(r.merge('guild_id' => id.to_s)) }
end

#fetch_sticker(sticker_id) ⇒ Sticker?

Fetch a specific guild sticker

Parameters:

  • sticker_id (String, Snowflake)

    Sticker ID

Returns:

  • (Sticker, nil)

    Sticker or nil



410
411
412
413
414
415
416
417
# File 'lib/discord_rda/entity/guild.rb', line 410

def fetch_sticker(sticker_id)
  return nil unless self.class.api

  data = self.class.api.get("/guilds/#{id}/stickers/#{sticker_id}")
  Sticker.new(data)
rescue RestClient::NotFoundError
  nil
end

#fetch_stickersArray<Sticker>

Fetch stickers for this guild

Returns:

  • (Array<Sticker>)

    Guild stickers



400
401
402
403
404
405
# File 'lib/discord_rda/entity/guild.rb', line 400

def fetch_stickers
  return [] unless self.class.api

  data = self.class.api.get("/guilds/#{id}/stickers")
  data.map { |s| Sticker.new(s) }
end

#fetch_voice_regionsArray<Hash>

Fetch voice regions for this guild

Returns:

  • (Array<Hash>)

    Voice regions



376
377
378
379
380
# File 'lib/discord_rda/entity/guild.rb', line 376

def fetch_voice_regions
  return [] unless self.class.api

  self.class.api.get("/guilds/#{id}/regions")
end

#fetch_webhooksArray<Hash>

Fetch webhooks for this guild

Returns:

  • (Array<Hash>)

    Guild webhooks



384
385
386
387
388
# File 'lib/discord_rda/entity/guild.rb', line 384

def fetch_webhooks
  return [] unless self.class.api

  self.class.api.get("/guilds/#{id}/webhooks")
end

#fetch_welcome_screenHash?

Fetch welcome screen

Returns:

  • (Hash, nil)

    Welcome screen data



356
357
358
359
360
361
362
# File 'lib/discord_rda/entity/guild.rb', line 356

def fetch_welcome_screen
  return nil unless self.class.api

  self.class.api.get("/guilds/#{id}/welcome-screen")
rescue RestClient::NotFoundError
  nil
end

#fetch_widget_settingsHash?

Fetch widget settings

Returns:

  • (Hash, nil)

    Widget settings



518
519
520
521
522
523
524
# File 'lib/discord_rda/entity/guild.rb', line 518

def fetch_widget_settings
  return nil unless self.class.api

  self.class.api.get("/guilds/#{id}/widget")
rescue RestClient::NotFoundError
  nil
end

#has_content_filter?Boolean

Check if guild has explicit content filter enabled

Returns:

  • (Boolean)

    True if has content filter



590
591
592
# File 'lib/discord_rda/entity/guild.rb', line 590

def has_content_filter?
  explicit_content_filter > 0
end

#has_description?Boolean

Check if guild has description

Returns:

  • (Boolean)

    True if has description



548
549
550
# File 'lib/discord_rda/entity/guild.rb', line 548

def has_description?
  description && !description.empty?
end

#has_vanity_url?Boolean

Check if guild has vanity URL feature

Returns:

  • (Boolean)

    True if has vanity URL



542
543
544
# File 'lib/discord_rda/entity/guild.rb', line 542

def has_vanity_url?
  !vanity_url_code.nil? && !vanity_url_code.empty?
end

#icon_url(format: 'png', size: nil) ⇒ String?

Get icon URL

Parameters:

  • format (String) (defaults to: 'png')

    Image format

  • size (Integer) (defaults to: nil)

    Image size

Returns:

  • (String, nil)

    Icon URL or nil if no icon



51
52
53
54
55
56
57
# File 'lib/discord_rda/entity/guild.rb', line 51

def icon_url(format: 'png', size: nil)
  return nil unless @raw_data['icon']

  url = "https://cdn.discordapp.com/icons/#{id}/#{@raw_data['icon']}.#{format}"
  url += "?size=#{size}" if size
  url
end

#invite_splash?Boolean

Check if guild has invite splash feature

Returns:

  • (Boolean)

    True if invite splash enabled



210
211
212
# File 'lib/discord_rda/entity/guild.rb', line 210

def invite_splash?
  feature?(:invite_splash)
end

#large?Boolean

Check if guild is large (250+ members)

Returns:

  • (Boolean)

    True if large



86
87
88
# File 'lib/discord_rda/entity/guild.rb', line 86

def large?
  (@raw_data['large'] || @raw_data['member_count'].to_i >= 250)
end

#likely_community?Boolean

Check if guild is likely community server

Returns:

  • (Boolean)

    True if community guild



566
567
568
# File 'lib/discord_rda/entity/guild.rb', line 566

def likely_community?
  community? || rules_channel_id || public_updates_channel_id
end

#localeSymbol

Get preferred locale as symbol

Returns:

  • (Symbol)

    Locale



261
262
263
# File 'lib/discord_rda/entity/guild.rb', line 261

def locale
  preferred_locale&.gsub('-', '_')&.downcase&.to_sym
end

#member_countInteger

Get member count

Returns:

  • (Integer)

    Member count



92
93
94
# File 'lib/discord_rda/entity/guild.rb', line 92

def member_count
  @raw_data['member_count'] || @raw_data['approximate_member_count'] || 0
end

#mfa_level_nameString

Get MFA level name

Returns:

  • (String)

    MFA level



116
117
118
# File 'lib/discord_rda/entity/guild.rb', line 116

def mfa_level_name
  %w[none elevated][mfa_level] || 'unknown'
end

#moderation_levelString

Get moderation level description

Returns:

  • (String)

    Moderation level



572
573
574
# File 'lib/discord_rda/entity/guild.rb', line 572

def moderation_level
  verification_level_name
end

#modify_sticker(sticker_id, name: nil, description: nil, tags: nil, reason: nil) ⇒ Sticker

Modify a guild sticker

Parameters:

  • sticker_id (String, Snowflake)

    Sticker ID

  • name (String) (defaults to: nil)

    New name

  • description (String) (defaults to: nil)

    New description

  • tags (String) (defaults to: nil)

    New tags

  • reason (String) (defaults to: nil)

    Audit log reason

Returns:



491
492
493
494
495
496
497
498
499
500
501
# File 'lib/discord_rda/entity/guild.rb', line 491

def modify_sticker(sticker_id, name: nil, description: nil, tags: nil, reason: nil)
  return nil unless self.class.api

  headers = {}
  headers['X-Audit-Log-Reason'] = CGI.escape(reason) if reason

  body = { name: name, description: description, tags: tags }.compact

  data = self.class.api.patch("/guilds/#{id}/stickers/#{sticker_id}", body: body, headers: headers)
  Sticker.new(data)
end

#nsfw_allowed?Boolean

Check if guild has NSFW content allowed

Returns:

  • (Boolean)

    True if NSFW allowed



596
597
598
# File 'lib/discord_rda/entity/guild.rb', line 596

def nsfw_allowed?
  nsfw_level > 0
end

#nsfw_level_nameString

Get NSFW level name

Returns:

  • (String)

    NSFW level



128
129
130
# File 'lib/discord_rda/entity/guild.rb', line 128

def nsfw_level_name
  %w[default explicit safe age_restricted][nsfw_level] || 'unknown'
end

#owner_idSnowflake

Get the owner’s snowflake ID

Returns:



43
44
45
# File 'lib/discord_rda/entity/guild.rb', line 43

def owner_id
  @owner_id ||= @raw_data['owner_id'] ? Snowflake.new(@raw_data['owner_id']) : nil
end

#partnered?Boolean

Check if partnered guild

Returns:

  • (Boolean)

    True if partnered



140
141
142
# File 'lib/discord_rda/entity/guild.rb', line 140

def partnered?
  feature?(:partnered)
end

#premium_tier_nameString

Get premium tier name (boost level)

Returns:

  • (String)

    Premium tier



122
123
124
# File 'lib/discord_rda/entity/guild.rb', line 122

def premium_tier_name
  %w[none tier_1 tier_2 tier_3][premium_tier] || 'unknown'
end

#requires_2fa?Boolean

Check if guild has 2FA requirement for moderation

Returns:

  • (Boolean)

    True if requires 2FA



584
585
586
# File 'lib/discord_rda/entity/guild.rb', line 584

def requires_2fa?
  mfa_level == 1
end

#requires_verification?Boolean

Check if guild requires verification

Returns:

  • (Boolean)

    True if requires verification



578
579
580
# File 'lib/discord_rda/entity/guild.rb', line 578

def requires_verification?
  verification_level > 0
end

#role(role_id) ⇒ Role?

Get a role by ID

Parameters:

Returns:

  • (Role, nil)

    Role or nil



179
180
181
182
# File 'lib/discord_rda/entity/guild.rb', line 179

def role(role_id)
  role_data = (@raw_data['roles'] || []).find { |r| r['id'] == role_id.to_s }
  Role.new(role_data.merge('guild_id' => id.to_s)) if role_data
end

#role_countInteger

Get role count

Returns:

  • (Integer)

    Number of roles



554
555
556
# File 'lib/discord_rda/entity/guild.rb', line 554

def role_count
  @raw_data['roles']&.length || 0
end

#role_objectsArray<Role>

Get Role objects from raw data

Returns:

  • (Array<Role>)

    Guild roles



172
173
174
# File 'lib/discord_rda/entity/guild.rb', line 172

def role_objects
  (@raw_data['roles'] || []).map { |r| Role.new(r.merge('guild_id' => id.to_s)) }
end

#splash_url(format: 'png', size: nil) ⇒ String?

Get splash URL (invite background)

Parameters:

  • format (String) (defaults to: 'png')

    Image format

  • size (Integer) (defaults to: nil)

    Image size

Returns:

  • (String, nil)

    Splash URL or nil



63
64
65
66
67
68
69
# File 'lib/discord_rda/entity/guild.rb', line 63

def splash_url(format: 'png', size: nil)
  return nil unless @raw_data['splash']

  url = "https://cdn.discordapp.com/splashes/#{id}/#{@raw_data['splash']}.#{format}"
  url += "?size=#{size}" if size
  url
end

#summaryHash

Get human-readable guild summary

Returns:

  • (Hash)

    Guild summary



602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
# File 'lib/discord_rda/entity/guild.rb', line 602

def summary
  {
    id: id.to_s,
    name: name,
    member_count: member_count,
    online_count: approximate_presence_count,
    boost_tier: boost_tier,
    boost_count: boost_count,
    features: features,
    large: large?,
    community: community?,
    partnered: partnered?,
    verified: verified?,
    available: available?
  }
end

#system_channel_flags_listArray<Symbol>

Get system channel flags as array

Returns:

  • (Array<Symbol>)

    Enabled flags



246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/discord_rda/entity/guild.rb', line 246

def system_channel_flags_list
  flags = []
  return flags unless system_channel_flags

  flags << :suppress_join_notifications if system_channel_flags & 1 == 1
  flags << :suppress_premium_subscriptions if system_channel_flags & 2 == 2
  flags << :suppress_guild_reminder_notifications if system_channel_flags & 4 == 4
  flags << :suppress_join_notification_replies if system_channel_flags & 8 == 8
  flags << :suppress_role_subscription_purchase_notifications if system_channel_flags & 16 == 16
  flags << :suppress_role_subscription_purchase_notification_replies if system_channel_flags & 32 == 32
  flags
end

#unavailable?Boolean

Check if guild is unavailable

Returns:

  • (Boolean)

    True if unavailable



273
274
275
# File 'lib/discord_rda/entity/guild.rb', line 273

def unavailable?
  @raw_data['unavailable'] || false
end

#vanity_invite_urlString?

Get guild vanity URL with code

Returns:

  • (String, nil)

    Vanity URL



534
535
536
537
538
# File 'lib/discord_rda/entity/guild.rb', line 534

def vanity_invite_url
  return nil unless vanity_url_code

  "https://discord.gg/#{vanity_url_code}"
end

#vanity_urlString?

Get vanity invite URL

Returns:

  • (String, nil)

    Vanity URL or nil



164
165
166
167
168
# File 'lib/discord_rda/entity/guild.rb', line 164

def vanity_url
  return nil unless @raw_data['vanity_url_code']

  "https://discord.gg/#{@raw_data['vanity_url_code']}"
end

#verification_level_nameString

Get verification level name

Returns:

  • (String)

    Verification level



98
99
100
# File 'lib/discord_rda/entity/guild.rb', line 98

def verification_level_name
  %w[none low medium high very_high][verification_level] || 'unknown'
end

#verified?Boolean

Check if verified guild

Returns:

  • (Boolean)

    True if verified



146
147
148
# File 'lib/discord_rda/entity/guild.rb', line 146

def verified?
  feature?(:verified)
end

#widget_urlString

Get widget URL

Returns:

  • (String)

    Widget URL



528
529
530
# File 'lib/discord_rda/entity/guild.rb', line 528

def widget_url
  "https://discord.com/widget?id=#{id}&theme=dark"
end