Class: LibDiscord::GuildTemplate
Overview
Guild Template Resource
Do not instantiate a GuildTemplate directly. Instead request from an instance of Client.
client = LibDiscord::Client.new("Bot auth.token")
g = client["guild_template"]
Instance Method Summary
collapse
Methods inherited from Resource
#initialize
Instance Method Details
#create_guild_from_guild_template(template_code:, json:) ⇒ Response
42
43
44
|
# File 'lib/lib_discord/guild_template.rb', line 42
def create_guild_from_guild_template(template_code:, json:)
send_request(:post, "/guilds/templates/#{template_code}", json:)
end
|
#create_guild_template(guild_id:, json:) ⇒ Response
74
75
76
|
# File 'lib/lib_discord/guild_template.rb', line 74
def create_guild_template(guild_id:, json:)
send_request(:post, "/guilds/#{guild_id}/templates", json:)
end
|
#delete_guild_template(guild_id:, template_code:) ⇒ Response
124
125
126
|
# File 'lib/lib_discord/guild_template.rb', line 124
def delete_guild_template(guild_id:, template_code:)
send_request(:delete, "/guilds/#{guild_id}/templates/#{template_code}")
end
|
#get_guild_template(template_code:) ⇒ Response
27
28
29
|
# File 'lib/lib_discord/guild_template.rb', line 27
def get_guild_template(template_code:)
send_request(:get, "/guilds/templates/#{template_code}")
end
|
#get_guild_templates(guild_id:) ⇒ Response
57
58
59
|
# File 'lib/lib_discord/guild_template.rb', line 57
def get_guild_templates(guild_id:)
send_request(:get, "/guilds/#{guild_id}/templates")
end
|
#modify_guild_template(guild_id:, template_code:, json:) ⇒ Response
108
109
110
|
# File 'lib/lib_discord/guild_template.rb', line 108
def modify_guild_template(guild_id:, template_code:, json:)
send_request(:patch, "/guilds/#{guild_id}/templates/#{template_code}", json:)
end
|
#sync_guild_template(guild_id:, template_code:) ⇒ Response
90
91
92
|
# File 'lib/lib_discord/guild_template.rb', line 90
def sync_guild_template(guild_id:, template_code:)
send_request(:put, "/guilds/#{guild_id}/templates/#{template_code}")
end
|