class Discorb::Sticker::GuildSticker

Represents a sticker of guilds.

Public Instance Methods

delete!(reason: nil) click to toggle source

Deletes the sticker. @macro async @macro http

@param [String] reason The reason for the deletion.

# File lib/discorb/sticker.rb, line 89
def delete!(reason: nil)
  Async do
    @client.http.delete("/guilds/#{@guild_id}/stickers/#{@id}", audit_log_reason: reason).wait
  end
end
Also aliased as: destroy!
destroy!(reason: nil)
Alias for: delete!
edit(name: :unset, description: :unset, tag: :unset, reason: :unset) click to toggle source

Edits the sticker. @macro async @macro http @macro edit

@param [String] name The new name of the sticker. @param [String] description The new description of the sticker. @param [Discorb::Emoji] tag The new tags of the sticker. @param [String] reason The reason for the edit.

# File lib/discorb/sticker.rb, line 70
def edit(name: :unset, description: :unset, tag: :unset, reason: :unset)
  Async do
    payload = {}
    payload[:name] = name unless name == :unset
    payload[:description] = description unless description == :unset
    payload[:tags] = tag.name unless tag == :unset
    @client.http.patch("/guilds/#{@guild_id}/stickers/#{@id}", payload, audit_log_reason: reason).wait
  end
end
Also aliased as: modify
guild() click to toggle source

@!attribute [r] guild

@macro client_cache
@return [Discorb::Guild] The guild the sticker is in.
# File lib/discorb/sticker.rb, line 55
def guild
  @client.guilds[@guild_id]
end
modify(name: :unset, description: :unset, tag: :unset, reason: :unset)
Alias for: edit