How to join a server?

前端 未结 3 1406
不思量自难忘°
不思量自难忘° 2020-12-12 16:44

I\'m trying to setup a discord bot with python. I have a pre-existing discord server that I would like the bot to join, but I\'m having a hard time doing so.



        
3条回答
  •  情歌与酒
    2020-12-12 17:23

    I suggest editing the code like this:

        @client.event
    async def on_ready():
        print('Logged in as')
        print(client.user.name)
        print(client.user.id)
        print('Invite: https://discordapp.com/oauth2/authorize?client_id={}&scope=bot'.format(client.user.id))
        print('------')
    

    I think this is the best and easiest solution. It works for me.

    EDIT: Discord actually made their own OAuth2 url generator, so use that: https://discordapp.com/developers/tools/oauth2-url-generator

提交回复
热议问题