Class: LibDiscord::Emoji

Inherits:
Resource show all
Defined in:
lib/lib_discord/emoji.rb

Overview

Emoji Resource

Do not instantiate an Emoji directly. Instead request one from an instance of Client.

client = LibDiscord::Client.new("Bot auth.token")
e = client["emoji"]

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from LibDiscord::Resource

Instance Method Details

#create_guild_emoji(guild_id:, json:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



64
65
66
# File 'lib/lib_discord/emoji.rb', line 64

def create_guild_emoji(guild_id:, json:)
  send_request(:post, "/guilds/#{guild_id}/emojis", json:)
end

#delete_guild_emoji(guild_id:, emoji_id:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



102
103
104
# File 'lib/lib_discord/emoji.rb', line 102

def delete_guild_emoji(guild_id:, emoji_id:)
  send_request(:delete, "/guilds/#{guild_id}/emojis/#{emoji_id}")
end

#get_guild_emoji(guild_id:, emoji_id:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



47
48
49
# File 'lib/lib_discord/emoji.rb', line 47

def get_guild_emoji(guild_id:, emoji_id:)
  send_request(:get, "/guilds/#{guild_id}/emojis/#{emoji_id}")
end

#list_guild_emojis(guild_id:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



29
30
31
# File 'lib/lib_discord/emoji.rb', line 29

def list_guild_emojis(guild_id:)
  send_request(:get, "/guilds/#{guild_id}/emojis")
end

#modify_guild_emoji(guild_id:, emoji_id:, json:) ⇒ Response

Parameters:

Returns:

Raises:

See Also:



84
85
86
# File 'lib/lib_discord/emoji.rb', line 84

def modify_guild_emoji(guild_id:, emoji_id:, json:)
  send_request(:patch, "/guilds/#{guild_id}/emojis/#{emoji_id}", json:)
end