A package that allows you to import a module to backup your members!
Project description
Usage:
from noms.auth import setup
setup() # do this once only
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)
Keep in mind that the code sample was generated by ChatGPT because I am too lazy..
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
noms-auth-2.3.tar.gz
(6.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file noms-auth-2.3.tar.gz.
File metadata
- Download URL: noms-auth-2.3.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2791f145721eec23093726d7300f877d8ac49577b7bbfa2df7f5855869be27ec
|
|
| MD5 |
a8340b9f16273c951acf68149be88815
|
|
| BLAKE2b-256 |
621caa1ab73c22e3b5e592f7009329bc05ebe9236577d0030f60f762b756c420
|
File details
Details for the file noms_auth-2.3-py3-none-any.whl.
File metadata
- Download URL: noms_auth-2.3-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c13435d64976aaa97aa6ed2f3247e7e49c99fb1aa9fc66c5c9caf7b2c5743bbe
|
|
| MD5 |
e37e5b854e09968a34b6633669e9ac6a
|
|
| BLAKE2b-256 |
f88172bbdbdd0765377cb935f647ad97836e3f7b169cf2aabb554c2d2c39885e
|