Skip to content

a simple library that extends the functions of discord.py and implements some oauth2 functions such as setting permissions for command apps to restrict their use and visibility

License

Notifications You must be signed in to change notification settings

yuhime/oathdiscord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installing

git clone https://github.com/yosaki0/oathdiscord
cd oathdiscord

# Linux/MacOS
python3 -m pip install .

# Windows
py -3 -m pip install .

Quick Example

import discord
from oathdiscord import OaBot
from oathdiscord.ext import OauthAppCommandPermissions


class Bot(OaBot):
    def __init__(self):
        intents = discord.Intents.default()
        intents.message_content = True

        super().__init__(
            command_prefix="?",
            bearer_token="<oauth2-token>",
            client_details=("<client-id>", "<client-secret>"),
            intents=intents,
        )


bot = Bot()


@bot.command()
async def modify_perms(ctx):
    guild_id = ctx.guild.id
    app_command_id = 123

    permissions = [OauthAppCommandPermissions(12938332444545, 1, False)]

    await bot.edit_app_command_perms(
        guild_id=guild_id, command_id=app_command_id, permissions=permissions
    )


bot.run("<token>")

About

a simple library that extends the functions of discord.py and implements some oauth2 functions such as setting permissions for command apps to restrict their use and visibility

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages