Module: OnyxCord::Bot::OAuth
- Included in:
- OnyxCord::Bot
- Defined in:
- lib/onyxcord/core/bot/oauth.rb
Instance Method Summary collapse
-
#create_oauth_application(name, redirect_uris) ⇒ Array(String, String)
Creates a new application to do OAuth authorization with.
-
#update_oauth_application(name, redirect_uris, description = '', icon = nil) ⇒ Object
Changes information about your OAuth application.
Instance Method Details
#create_oauth_application(name, redirect_uris) ⇒ Array(String, String)
Creates a new application to do OAuth authorization with. This allows you to use OAuth to authorize users using Discord. For information how to use this, see the docs: https://discord.com/developers/docs/topics/oauth2
11 12 13 14 |
# File 'lib/onyxcord/core/bot/oauth.rb', line 11 def create_oauth_application(name, redirect_uris) response = OnyxCord::Internal::JSON.parse(REST.create_oauth_application(@token, name, redirect_uris)) [response['id'], response['secret']] end |
#update_oauth_application(name, redirect_uris, description = '', icon = nil) ⇒ Object
Changes information about your OAuth application
22 23 24 |
# File 'lib/onyxcord/core/bot/oauth.rb', line 22 def update_oauth_application(name, redirect_uris, description = '', icon = nil) REST.update_oauth_application(@token, name, redirect_uris, description, icon) end |