Method: Discordrb::Bot#invite_url
- Defined in:
- lib/discordrb/bot.rb
#invite_url(server: nil, permission_bits: nil) ⇒ String
Creates an OAuth invite URL that can be used to invite this bot to a particular server. Requires the application ID to have been set during initialization.
267 268 269 270 271 272 273 |
# File 'lib/discordrb/bot.rb', line 267 def invite_url(server: nil, permission_bits: nil) raise 'No application ID has been set during initialization! Add one as the `application_id` named parameter while creating your bot.' unless @client_id server_id_str = server ? "&guild_id=#{server.id}" : '' = ? "&permissions=#{}" : '' "https://discordapp.com/oauth2/authorize?&client_id=#{@client_id}#{server_id_str}#{}&scope=bot" end |