Skip to content

Commit

Permalink
feat: add owner-only invite command
Browse files Browse the repository at this point in the history
  • Loading branch information
thegamecracks committed Jun 17, 2024
1 parent 0c2fa55 commit 1e04420
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/theticketbot/cogs/owner.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ async def sync(self, ctx: Context, guild_id: int | None = None):
f"with a total of {n_localizations} localizations!"
)

@commands.command(name="invite")
async def invite(self, ctx: Context):
"""Provide an invite link for the bot with minimal permissions."""
assert self.bot.application_id is not None
link = discord.utils.oauth_url(
self.bot.application_id,
permissions=discord.Permissions(
read_messages=True,
send_messages=True,
embed_links=True,
attach_files=True,
create_private_threads=True,
send_messages_in_threads=True,
),
scopes=("bot",),
)
await ctx.reply(link)


async def setup(bot: Bot):
await bot.add_cog(Owner(bot))

0 comments on commit 1e04420

Please sign in to comment.