【问题标题】:Discord Authorize ApplicationDiscord 授权申请
【发布时间】:2021-06-05 00:47:10
【问题描述】:

我想用 Python 制作一个可以自动为您设置服务器的机器人。我知道如何使用 bot 做所有事情,除了 Bot 自动添加你的部分。

我如何授权应用程序允许它将我添加到服务器以及之后如何让它将我添加到服务器?

编辑:我尝试了https://github.com/discord/discord-oauth2-example,但由于重定向 URI 无效,这不起作用。

【问题讨论】:

    标签: python oauth-2.0 discord discord.py


    【解决方案1】:

    我不知道,但我有一个简单的脚本可以创建一个公会,然后创建一个邀请链接并邀请你加入已创建的公会。

    之后你所要做的就是“!create Guild_Name”

    这是代码;

    @bot.command()
    async def create(ctx, *, name):
        guild = await bot.create_guild(name=name)
        channel = await guild.create_text_channel('welcome')
        invite_link = await channel.create_invite()
        await ctx.send(f"Succesfully created **{guild.name}**. (ID: {guild.id})\n"
            f"{invite_link}")
    

    【讨论】:

      猜你喜欢
      • 2012-06-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-17
      • 1970-01-01
      • 2017-07-05
      • 2017-09-27
      相关资源
      最近更新 更多