Skip to content

Commit

Permalink
Merge pull request #20 from parker02311/package-dev
Browse files Browse the repository at this point in the history
Change Redon Hub to be a package
  • Loading branch information
parker02311 authored Dec 6, 2024
2 parents dc43dbf + c3110a3 commit 51c1979
Show file tree
Hide file tree
Showing 30 changed files with 1,437 additions and 403 deletions.
6 changes: 6 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ pillow = "==11.0.0"
requests = "==2.32.3"

[dev-packages]
mkdocs-material = "*"
mkdocstrings = "*"
httpx = "*"
mkdocs-literate-nav = "*"
mkdocs-gen-files = "*"
mkdocs-mermaid2-plugin = "*"

[requires]
python_version = "3.9"
1,280 changes: 1,001 additions & 279 deletions Pipfile.lock

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ or view API documentation on your hub by adding `/docs` to the end of your hub's
| Complete | Tag Commands | Tag related commands |


### V1.1

| Status | Name | Description |
| ------ | ---- | ----------- |
### V2

| Status | Name | Description |
| ----------- | ------- | --------------------------- |
| In Progress | Package | Turn the hub into a package |

### Version To Be Determined
| Status | Name | Description | Reason TBD |
Expand All @@ -65,3 +65,7 @@ or view API documentation on your hub by adding `/docs` to the end of your hub's
| In Planning | Product Loaning | N/A | Haven't planned that far ahead |
| In Planning | Product Licenses | N/A | Haven't planned that far ahead |
| In Planning | Product Grant Log Title | N/A | Haven't planned that far ahead |

Packaging ideas:
- Copy the bot folder into the directory asked
- Launch the bot from the current directory if it exists
60 changes: 0 additions & 60 deletions bot/utils/logging.py

This file was deleted.

2 changes: 2 additions & 0 deletions example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
token=insert_token_here
database=insert_database_connector_here
31 changes: 0 additions & 31 deletions launcher.py

This file was deleted.

42 changes: 42 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[build-system]
requires = ["setuptools>=64"]
build-backend = "setuptools.build_meta"

[project]
name = "Redon-Hub"
description = "A product purchasing bot for Roblox groups. A.K.A. Hub."
authors = [
{name = "parker02311", email = "[email protected]"},
{name = "Redon Tech"}
]
readme = "README.md"
license = {file = "LICENSE"}
keywords = ["roblox", "product", "purchasing", "bot", "hub"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Lua",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Topic :: Office/Business :: Financial",
]
dynamic = ["version", "dependencies"]
requires-python = ">= 3.9"

[project.urls]
Funding = "https://ko-fi.com/parker02311"
Documentation = "https://hub.redon.tech"
Repository = "https://github.com/Redon-Tech/Redon-Hub"
Issues = "https://github.com/Redon-Tech/Redon-Hub/issues"
Changelog = "https://github.com/Redon-Tech/Redon-Hub/releases"

[project.scripts]
Redon-Hub = "redonhub.cli:main"

[tool.setuptools.packages.find]
exclude = ["roblox", "docs"]

[tool.setuptools.dynamic]
version = {attr = "redonhub.__version__"}
dependencies = {file = ["requirements.txt"]}
18 changes: 15 additions & 3 deletions bot/__init__.py → redonhub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import datetime

_log = logging.getLogger(__name__)
__version__ = "1.0.2"
__version__ = "2.0-rc.1"


class Bot(BotBase):
Expand All @@ -35,7 +35,7 @@ async def load_extensions(self):

for cog in cogs:
_log.info(f"Bot: Loading Extension {cog}")
await self.load_extension(f"bot.cogs.{cog}")
await self.load_extension(f"redonhub.cogs.{cog}")

await self.sync_commands()

Expand All @@ -53,12 +53,24 @@ async def sync_commands(self):
async def on_ready(self):
if not self.ready:
self.ready = True
_log.info(f"Bot Online | {self.user} | {self.user and self.user.id}")
_log.info(f"Bot Ready")

await database.connect()

_log.info("Database Connected")

_log.info(f"Bot Online | {self.user} | { self.user and self.user.id}")
bot = self.user
if bot:
_log.info(
f"Quick Invite Link: https://discord.com/oauth2/authorize?client_id={bot.id}&permissions=8&integration_type=0&scope=applications.commands+bot"
)
_log.warning(
"Quick Invite Link gives the bot all permissions, please ensure to not leak your bot token."
)
else:
_log.info("Unable to generate Quick Invite Link")

async def on_app_command_error(
self, interaction: Interaction, error: AppCommandError
):
Expand Down
Loading

0 comments on commit 51c1979

Please sign in to comment.