Class: DiscordRDA::Guild
- Defined in:
- lib/discord_rda/entity/guild.rb
Overview
Represents a Discord guild (server).
Class Attribute Summary collapse
-
.api ⇒ Object
Returns the value of attribute api.
Attributes inherited from Entity
Instance Method Summary collapse
-
#animated_banner? ⇒ Boolean
Check if guild has animated banner.
-
#animated_icon? ⇒ Boolean
Check if guild has animated icon.
-
#approximate_member_count ⇒ Integer?
Get approximate member count.
-
#approximate_presence_count ⇒ Integer?
Get approximate presence count.
-
#available? ⇒ Boolean
Check if guild is available (not unavailable due to outage).
-
#banner_feature? ⇒ Boolean
Check if guild has banner feature.
-
#boost_count ⇒ Integer
Get number of boosts.
-
#boost_progress_bar? ⇒ Boolean
Check if boost progress bar is enabled.
-
#boost_tier ⇒ String
Get boost count as tier name.
-
#community? ⇒ Boolean
Check if community guild.
-
#create_sticker(name:, description:, tags:, file:, reason: nil) ⇒ Sticker
Create a guild sticker.
-
#default_message_notifications_name ⇒ String
Get default message notifications setting name.
-
#delete_sticker(sticker_id, reason: nil) ⇒ void
Delete a guild sticker.
-
#discovery_splash_url(format: 'png', size: nil) ⇒ String?
Get discovery splash URL.
-
#emoji_count ⇒ Integer
Get emoji count.
-
#emoji_objects ⇒ Array<Emoji>
Get Emoji objects from raw data.
-
#explicit_content_filter_name ⇒ String
Get explicit content filter name.
-
#feature?(feature) ⇒ Boolean
Check if guild has a specific feature.
-
#features ⇒ Array<String>
Get available features.
-
#fetch_bans(limit: 100) ⇒ Array<Hash>
Fetch bans in this guild.
-
#fetch_channels ⇒ Array<Channel>
Fetch channels in this guild.
-
#fetch_integrations ⇒ Array<Hash>
Fetch integrations for this guild.
-
#fetch_invites ⇒ Array<Hash>
Fetch active invites for this guild.
-
#fetch_member(user_id) ⇒ Member?
Fetch a member from this guild.
-
#fetch_members(limit: 100, after: nil) ⇒ Array<Member>
Fetch members from this guild (simplified pagination).
-
#fetch_onboarding ⇒ Hash?
Fetch onboarding settings.
-
#fetch_preview ⇒ Hash?
Fetch guild preview (for lurkable guilds).
-
#fetch_roles ⇒ Array<Role>
Fetch roles in this guild.
-
#fetch_sticker(sticker_id) ⇒ Sticker?
Fetch a specific guild sticker.
-
#fetch_stickers ⇒ Array<Sticker>
Fetch stickers for this guild.
-
#fetch_voice_regions ⇒ Array<Hash>
Fetch voice regions for this guild.
-
#fetch_webhooks ⇒ Array<Hash>
Fetch webhooks for this guild.
-
#fetch_welcome_screen ⇒ Hash?
Fetch welcome screen.
-
#fetch_widget_settings ⇒ Hash?
Fetch widget settings.
-
#has_content_filter? ⇒ Boolean
Check if guild has explicit content filter enabled.
-
#has_description? ⇒ Boolean
Check if guild has description.
-
#has_vanity_url? ⇒ Boolean
Check if guild has vanity URL feature.
-
#icon_url(format: 'png', size: nil) ⇒ String?
Get icon URL.
-
#invite_splash? ⇒ Boolean
Check if guild has invite splash feature.
-
#large? ⇒ Boolean
Check if guild is large (250+ members).
-
#likely_community? ⇒ Boolean
Check if guild is likely community server.
-
#locale ⇒ Symbol
Get preferred locale as symbol.
-
#member_count ⇒ Integer
Get member count.
-
#mfa_level_name ⇒ String
Get MFA level name.
-
#moderation_level ⇒ String
Get moderation level description.
-
#modify_sticker(sticker_id, name: nil, description: nil, tags: nil, reason: nil) ⇒ Sticker
Modify a guild sticker.
-
#nsfw_allowed? ⇒ Boolean
Check if guild has NSFW content allowed.
-
#nsfw_level_name ⇒ String
Get NSFW level name.
-
#owner_id ⇒ Snowflake
Get the owner’s snowflake ID.
-
#partnered? ⇒ Boolean
Check if partnered guild.
-
#premium_tier_name ⇒ String
Get premium tier name (boost level).
-
#requires_2fa? ⇒ Boolean
Check if guild has 2FA requirement for moderation.
-
#requires_verification? ⇒ Boolean
Check if guild requires verification.
-
#role(role_id) ⇒ Role?
Get a role by ID.
-
#role_count ⇒ Integer
Get role count.
-
#role_objects ⇒ Array<Role>
Get Role objects from raw data.
-
#splash_url(format: 'png', size: nil) ⇒ String?
Get splash URL (invite background).
-
#summary ⇒ Hash
Get human-readable guild summary.
-
#system_channel_flags_list ⇒ Array<Symbol>
Get system channel flags as array.
-
#unavailable? ⇒ Boolean
Check if guild is unavailable.
-
#vanity_invite_url ⇒ String?
Get guild vanity URL with code.
-
#vanity_url ⇒ String?
Get vanity invite URL.
-
#verification_level_name ⇒ String
Get verification level name.
-
#verified? ⇒ Boolean
Check if verified guild.
-
#widget_url ⇒ String
Get widget URL.
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
.api ⇒ Object
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
216 217 218 |
# File 'lib/discord_rda/entity/guild.rb', line 216 def feature?(:animated_banner) end |
#animated_icon? ⇒ Boolean
Check if guild has animated icon
222 223 224 |
# File 'lib/discord_rda/entity/guild.rb', line 222 def animated_icon? feature?(:animated_icon) end |
#approximate_member_count ⇒ Integer?
Get approximate member count
152 153 154 |
# File 'lib/discord_rda/entity/guild.rb', line 152 def approximate_member_count @raw_data['approximate_member_count'] end |
#approximate_presence_count ⇒ Integer?
Get approximate presence count
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)
267 268 269 |
# File 'lib/discord_rda/entity/guild.rb', line 267 def available? !@raw_data['unavailable'] end |
#banner_feature? ⇒ Boolean
Check if guild has banner feature
204 205 206 |
# File 'lib/discord_rda/entity/guild.rb', line 204 def feature?(:banner) end |
#boost_count ⇒ Integer
Get number of boosts
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
240 241 242 |
# File 'lib/discord_rda/entity/guild.rb', line 240 def end |
#boost_tier ⇒ String
Get boost count as tier name
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
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
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: } 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_name ⇒ String
Get default message notifications setting name
104 105 106 |
# File 'lib/discord_rda/entity/guild.rb', line 104 def %w[all_messages only_mentions][] || 'unknown' end |
#delete_sticker(sticker_id, reason: nil) ⇒ void
This method returns an undefined value.
Delete a guild sticker
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
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_count ⇒ Integer
Get emoji count
560 561 562 |
# File 'lib/discord_rda/entity/guild.rb', line 560 def emoji_count @raw_data['emojis']&.length || 0 end |
#emoji_objects ⇒ Array<Emoji>
Get Emoji objects from raw data
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_name ⇒ String
Get explicit content filter name
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
74 75 76 |
# File 'lib/discord_rda/entity/guild.rb', line 74 def feature?(feature) features.include?(feature.to_s.upcase) end |
#features ⇒ Array<String>
Get available 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
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_channels ⇒ Array<Channel>
Fetch channels in this guild
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_integrations ⇒ Array<Hash>
Fetch integrations for this guild
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_invites ⇒ Array<Hash>
Fetch active invites for this guild
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
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)
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_onboarding ⇒ Hash?
Fetch onboarding settings
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_preview ⇒ Hash?
Fetch guild preview (for lurkable guilds)
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_roles ⇒ Array<Role>
Fetch roles in this guild
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
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_stickers ⇒ Array<Sticker>
Fetch stickers for this guild
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_regions ⇒ Array<Hash>
Fetch voice regions for this guild
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_webhooks ⇒ Array<Hash>
Fetch webhooks for this guild
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_screen ⇒ Hash?
Fetch welcome screen
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_settings ⇒ Hash?
Fetch widget settings
518 519 520 521 522 523 524 |
# File 'lib/discord_rda/entity/guild.rb', line 518 def 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
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
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
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
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
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)
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
566 567 568 |
# File 'lib/discord_rda/entity/guild.rb', line 566 def likely_community? community? || rules_channel_id || public_updates_channel_id end |
#locale ⇒ Symbol
Get preferred locale as symbol
261 262 263 |
# File 'lib/discord_rda/entity/guild.rb', line 261 def locale preferred_locale&.gsub('-', '_')&.downcase&.to_sym end |
#member_count ⇒ Integer
Get 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_name ⇒ String
Get MFA level name
116 117 118 |
# File 'lib/discord_rda/entity/guild.rb', line 116 def mfa_level_name %w[none elevated][mfa_level] || 'unknown' end |
#moderation_level ⇒ String
Get moderation level description
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
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: }.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
596 597 598 |
# File 'lib/discord_rda/entity/guild.rb', line 596 def nsfw_allowed? nsfw_level > 0 end |
#nsfw_level_name ⇒ String
Get NSFW level name
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_id ⇒ Snowflake
Get the owner’s snowflake ID
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
140 141 142 |
# File 'lib/discord_rda/entity/guild.rb', line 140 def partnered? feature?(:partnered) end |
#premium_tier_name ⇒ String
Get premium tier name (boost level)
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
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
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
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_count ⇒ Integer
Get role count
554 555 556 |
# File 'lib/discord_rda/entity/guild.rb', line 554 def role_count @raw_data['roles']&.length || 0 end |
#role_objects ⇒ Array<Role>
Get Role objects from raw data
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)
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 |
#summary ⇒ Hash
Get human-readable 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_list ⇒ Array<Symbol>
Get system channel flags as array
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
273 274 275 |
# File 'lib/discord_rda/entity/guild.rb', line 273 def unavailable? @raw_data['unavailable'] || false end |
#vanity_invite_url ⇒ String?
Get guild vanity URL with code
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_url ⇒ String?
Get vanity invite URL
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_name ⇒ String
Get verification level name
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
146 147 148 |
# File 'lib/discord_rda/entity/guild.rb', line 146 def verified? feature?(:verified) end |
#widget_url ⇒ String
Get widget URL
528 529 530 |
# File 'lib/discord_rda/entity/guild.rb', line 528 def "https://discord.com/widget?id=#{id}&theme=dark" end |