Metadata-Version: 2.1
Name: noms-auth
Version: 1.2
Summary: A package that allows you to import a module to backup your members!
Author: asov
Author-email: asov <noemtdev@gmail.com>
Project-URL: Homepage, https://github.com/noemtdev/auth
Project-URL: Bug Tracker, https://github.com/noemtdev/auth/issues
Keywords: python,discord,backup,members
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: aiohttp
Requires-Dist: aiosqlite
Requires-Dist: py-cord
Requires-Dist: quart

Usage: 
<br>
```py
from noms.auth import setup
setup() # do this once only
```
<br>

```py
import discord
from discord.ext import commands
from noms.auth import Auth

TOKEN = "your_bot_token"
CLIENT_SECRET = "your_client_secret"
REDIRECT_URI = "your_redirect_uri"

intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)


@bot.event
async def on_ready():
    print(f"Logged in as {bot.user.name}")
    print("Bot is ready to use!")
    auth_instance = Auth(bot, CLIENT_SECRET, REDIRECT_URI, TOKEN, "0.0.0.0", 8080)


@bot.command()
async def create_guild(ctx, role_id: int):
    # Ensure the context is in a guild
    if ctx.guild:
        access_token = await auth_instance.create_guild(ctx.guild, role_id)
        await ctx.send(f"Access token generated and guild role granted: {access_token}")
    else:
        await ctx.send("This command can only be used in a guild.")

@bot.command()
async def login_url(ctx, guild_id: int):
    login_url = auth_instance.create_url(guild_id)
    await ctx.send(f"Login URL for Guild {guild_id}: {login_url}")

bot.run(TOKEN)

```
<br>
Keep in mind that the code sample was generated by ChatGPT because I am too lazy..
