Compare commits
6 commits
renovate/w
...
main
Author | SHA1 | Date | |
---|---|---|---|
10b31c81b3 | |||
3fdb0836cf | |||
6bd2a2cc68 | |||
48c6289b2d | |||
346963fd4f | |||
d89c156744 |
9 changed files with 101 additions and 87 deletions
|
@ -1,4 +1,4 @@
|
|||
FROM ghcr.io/astral-sh/uv:0.5.24@sha256:2381d6aa60c326b71fd40023f921a0a3b8f91b14d5db6b90402e65a635053709 AS uv
|
||||
FROM ghcr.io/astral-sh/uv:0.5.30@sha256:bb74263127d6451222fe7f71b330edfb189ab1c98d7898df2401fbf4f272d9b9 AS uv
|
||||
FROM python:3.11-slim@sha256:6ed5bff4d7d377e2a27d9285553b8c21cfccc4f00881de1b24c9bc8d90016e82 AS python
|
||||
FROM code.forgejo.org/forgejo/runner:6.2.1@sha256:fecc96a111a15811a6887ce488e75718089f24599e613e93db8e54fe70b706e8 AS forgejo-runner
|
||||
|
||||
|
|
|
@ -8,5 +8,8 @@ charset = utf-8
|
|||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.py]
|
||||
indent_size = 4
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
|
|
@ -30,7 +30,7 @@ jobs:
|
|||
docs:
|
||||
name: Build Documentation (MkDocs)
|
||||
runs-on: docker
|
||||
container: www.coastalcommits.com/cswimr/actions:docs@sha256:5aa3df18a28ca7059ad727f8bb7fcd2a2e8ba42772bf438dafd5c56dad2d121e
|
||||
container: www.coastalcommits.com/cswimr/actions:docs@sha256:e405cd6b9b1182a570ddee32ed8dd1b2f899edc625d006c8b4b2f18c100e724f
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
|
|
@ -9,7 +9,10 @@
|
|||
"hidden": false,
|
||||
"disabled": false,
|
||||
"min_bot_version": "3.5.0",
|
||||
"min_python_version": [3, 8, 0],
|
||||
"requirements": ["git+https://github.com/cswimr/pydactyl", "websockets"],
|
||||
"min_python_version": [3, 10, 0],
|
||||
"requirements": [
|
||||
"git+https://github.com/iamkubi/pydactyl@v2.0.5",
|
||||
"websockets"
|
||||
],
|
||||
"tags": ["pterodactyl", "minecraft", "server", "management"]
|
||||
}
|
||||
|
|
|
@ -2,6 +2,14 @@ import aiohttp
|
|||
|
||||
|
||||
async def get_status(host: str, port: int = 25565) -> tuple[bool, dict]:
|
||||
"""Get the status of a Minecraft server using the [mcsrvstat.us API](https://api.mcsrvstat.us).
|
||||
|
||||
Args:
|
||||
host (str): The host of the server.
|
||||
port (int, optional): The port to connect to. Defaults to 25565.
|
||||
|
||||
Returns:
|
||||
A tuple containing a boolean and a dictionary. The boolean is True if the server is online, or False if it is offline. The dictionary contains the response from the API."""
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(f"https://api.mcsrvstat.us/2/{host}:{port}") as response:
|
||||
response = await response.json() # noqa: PLW2901
|
||||
|
|
|
@ -23,7 +23,7 @@ class Pterodactyl(commands.Cog):
|
|||
|
||||
__author__ = ["[cswimr](https://www.coastalcommits.com/cswimr)"]
|
||||
__git__ = "https://www.coastalcommits.com/cswimr/SeaCogs"
|
||||
__version__ = "2.0.6"
|
||||
__version__ = "2.0.8"
|
||||
__documentation__ = "https://seacogs.coastalcommits.com/pterodactyl/"
|
||||
|
||||
def __init__(self, bot: Red):
|
||||
|
@ -416,7 +416,7 @@ class Pterodactyl(commands.Cog):
|
|||
- `.$V` (version)
|
||||
- `.$D` (description / Message of the Day)"""
|
||||
await config.topic.set(text)
|
||||
await ctx.send(f"Topic set to:\n{box(text, 'yaml')}")
|
||||
await ctx.send(f"Topic set to:\n{box(text, 'markdown')}")
|
||||
|
||||
@pterodactyl_config.group(name="chat")
|
||||
async def pterodactyl_config_chat(self, ctx: commands.Context):
|
||||
|
@ -607,19 +607,19 @@ class Pterodactyl(commands.Cog):
|
|||
|
||||
**Topic Hostname:** `{topic_hostname}`
|
||||
**Topic Port:** `{topic_port}`
|
||||
**Topic Text:** {box(topic_text, "yaml")}
|
||||
**Topic Text:** {box(topic_text, "markdown")}
|
||||
|
||||
**Chat Command:** {box(chat_command, "json")}
|
||||
**Chat Regex:** {box(chat_regex, "re")}
|
||||
**Server Regex:** {box(server_regex, "re")}
|
||||
**Join Regex:** {box(join_regex, "re")}
|
||||
**Leave Regex:** {box(leave_regex, "re")}
|
||||
**Achievement Regex:** {box(achievement_regex, "re")}"""
|
||||
**Chat Regex:** {box(chat_regex, "regex")}
|
||||
**Server Regex:** {box(server_regex, "regex")}
|
||||
**Join Regex:** {box(join_regex, "regex")}
|
||||
**Leave Regex:** {box(leave_regex, "regex")}
|
||||
**Achievement Regex:** {box(achievement_regex, "regex")}"""
|
||||
await ctx.send(embed=embed)
|
||||
if not len(regex_blacklist) == 0:
|
||||
regex_blacklist_embed = discord.Embed(color=await ctx.embed_color(), title="Regex Blacklist")
|
||||
for name, regex in regex_blacklist.items():
|
||||
regex_blacklist_embed.add_field(name=name, value=box(regex, "re"), inline=False)
|
||||
regex_blacklist_embed.add_field(name=name, value=box(regex, "regex"), inline=False)
|
||||
await ctx.send(embed=regex_blacklist_embed)
|
||||
|
||||
def get_bool_str(self, inp: bool) -> str:
|
||||
|
|
|
@ -153,7 +153,7 @@ async def retrieve_websocket_credentials(coginstance: Pterodactyl) -> dict:
|
|||
|
||||
client = PterodactylClient(base_url, api_key).client
|
||||
coginstance.client = client
|
||||
websocket_credentials: dict[str, Any] = client.servers.get_websocket(server_id).json()
|
||||
websocket_credentials: dict[str, Any] = client.servers.get_websocket(server_id)
|
||||
if not websocket_credentials:
|
||||
coginstance.maybe_cancel_task()
|
||||
raise ValueError("Failed to retrieve websocket credentials. Please ensure the API details are correctly configured.")
|
||||
|
|
|
@ -36,7 +36,7 @@ documentation = [
|
|||
dev-dependencies = ["pylint>=3.3.3", "ruff>=0.9.3", "sqlite-web>=0.6.4"]
|
||||
|
||||
[tool.uv.sources]
|
||||
py-dactyl = { git = "https://github.com/cswimr/pydactyl" }
|
||||
py-dactyl = { git = "https://github.com/iamkubi/pydactyl", tag = "v2.0.5" }
|
||||
|
||||
[tool.basedpyright]
|
||||
typeCheckingMode = "basic"
|
||||
|
|
8
uv.lock
generated
8
uv.lock
generated
|
@ -592,7 +592,7 @@ name = "importlib-metadata"
|
|||
version = "8.5.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "zipp" },
|
||||
{ name = "zipp", marker = "python_full_version >= '3.12'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/cd/12/33e59336dca5be0c398a7482335911a33aa0e20776128f038019f1a95f1b/importlib_metadata-8.5.0.tar.gz", hash = "sha256:71522656f0abace1d072b9e5481a48f07c138e00f079c38c8f883823f9c26bd7", size = 55304 }
|
||||
wheels = [
|
||||
|
@ -1227,8 +1227,8 @@ wheels = [
|
|||
|
||||
[[package]]
|
||||
name = "py-dactyl"
|
||||
version = "2.0.4"
|
||||
source = { git = "https://github.com/cswimr/pydactyl#a8ad40c21b3fe2248451fd85a1146b32d29f10df" }
|
||||
version = "2.0.5"
|
||||
source = { git = "https://github.com/iamkubi/pydactyl?tag=v2.0.5#ef5d8b9b807f67067dc1214097abf01ddb7e551f" }
|
||||
dependencies = [
|
||||
{ name = "requests" },
|
||||
]
|
||||
|
@ -1701,7 +1701,7 @@ requires-dist = [
|
|||
{ name = "phx-class-registry", specifier = ">=5.1.1" },
|
||||
{ name = "pillow", specifier = ">=10.4.0" },
|
||||
{ name = "pip", specifier = ">=25.0" },
|
||||
{ name = "py-dactyl", git = "https://github.com/cswimr/pydactyl" },
|
||||
{ name = "py-dactyl", git = "https://github.com/iamkubi/pydactyl?tag=v2.0.5" },
|
||||
{ name = "pydantic", specifier = ">=2.10.6" },
|
||||
{ name = "red-discordbot", specifier = ">=3.5.14" },
|
||||
{ name = "watchdog", specifier = ">=6.0.0" },
|
||||
|
|
Loading…
Add table
Reference in a new issue