noms-auth


Namenoms-auth JSON
Version 2.3 PyPI version JSON
download
home_page
SummaryA package that allows you to import a module to backup your members!
upload_time2023-08-16 11:57:15
maintainer
docs_urlNone
authorasov
requires_python>=3.7
license
keywords python discord backup members
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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..

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "noms-auth",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "python,discord,backup,members",
    "author": "asov",
    "author_email": "asov <noemtdev@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/62/1c/aa1ab73c22e3b5e592f7009329bc05ebe9236577d0030f60f762b756c420/noms-auth-2.3.tar.gz",
    "platform": null,
    "description": "Usage: \r\n<br>\r\n```py\r\nfrom noms.auth import setup\r\nsetup() # do this once only\r\n```\r\n<br>\r\n\r\n```py\r\nimport discord\r\nfrom discord.ext import commands\r\nfrom noms.auth import Auth\r\n\r\nTOKEN = \"your_bot_token\"\r\nCLIENT_SECRET = \"your_client_secret\"\r\nREDIRECT_URI = \"your_redirect_uri\"\r\n\r\nintents = discord.Intents.default()\r\nintents.members = True\r\nbot = commands.Bot(command_prefix=\"!\", intents=intents)\r\n\r\n\r\n@bot.event\r\nasync def on_ready():\r\n    print(f\"Logged in as {bot.user.name}\")\r\n    print(\"Bot is ready to use!\")\r\n    auth_instance = Auth(bot, CLIENT_SECRET, REDIRECT_URI, TOKEN, \"0.0.0.0\", 8080)\r\n\r\n\r\n@bot.command()\r\nasync def create_guild(ctx, role_id: int):\r\n    # Ensure the context is in a guild\r\n    if ctx.guild:\r\n        access_token = await auth_instance.create_guild(ctx.guild, role_id)\r\n        await ctx.send(f\"Access token generated and guild role granted: {access_token}\")\r\n    else:\r\n        await ctx.send(\"This command can only be used in a guild.\")\r\n\r\n@bot.command()\r\nasync def login_url(ctx, guild_id: int):\r\n    login_url = auth_instance.create_url(guild_id)\r\n    await ctx.send(f\"Login URL for Guild {guild_id}: {login_url}\")\r\n\r\nbot.run(TOKEN)\r\n\r\n```\r\n<br>\r\nKeep in mind that the code sample was generated by ChatGPT because I am too lazy..\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A package that allows you to import a module to backup your members!",
    "version": "2.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/noemtdev/auth/issues",
        "Homepage": "https://github.com/noemtdev/auth"
    },
    "split_keywords": [
        "python",
        "discord",
        "backup",
        "members"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f88172bbdbdd0765377cb935f647ad97836e3f7b169cf2aabb554c2d2c39885e",
                "md5": "e37e5b854e09968a34b6633669e9ac6a",
                "sha256": "c13435d64976aaa97aa6ed2f3247e7e49c99fb1aa9fc66c5c9caf7b2c5743bbe"
            },
            "downloads": -1,
            "filename": "noms_auth-2.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e37e5b854e09968a34b6633669e9ac6a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6099,
            "upload_time": "2023-08-16T11:57:13",
            "upload_time_iso_8601": "2023-08-16T11:57:13.498313Z",
            "url": "https://files.pythonhosted.org/packages/f8/81/72bbdbdd0765377cb935f647ad97836e3f7b169cf2aabb554c2d2c39885e/noms_auth-2.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "621caa1ab73c22e3b5e592f7009329bc05ebe9236577d0030f60f762b756c420",
                "md5": "a8340b9f16273c951acf68149be88815",
                "sha256": "2791f145721eec23093726d7300f877d8ac49577b7bbfa2df7f5855869be27ec"
            },
            "downloads": -1,
            "filename": "noms-auth-2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "a8340b9f16273c951acf68149be88815",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6207,
            "upload_time": "2023-08-16T11:57:15",
            "upload_time_iso_8601": "2023-08-16T11:57:15.847680Z",
            "url": "https://files.pythonhosted.org/packages/62/1c/aa1ab73c22e3b5e592f7009329bc05ebe9236577d0030f60f762b756c420/noms-auth-2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-16 11:57:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "noemtdev",
    "github_project": "auth",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "noms-auth"
}
        
Elapsed time: 0.09931s