Compare commits

..

No commits in common. "cbfff6d21189328abe8dc277543dcd72804980f9" and "571be4e2458be16e3eec6f7ea246e8912eb95061" have entirely different histories.

8 changed files with 40 additions and 69 deletions

View file

@ -9,15 +9,14 @@ import discord
from red_commons.logging import getLogger from red_commons.logging import getLogger
from redbot.core import commands from redbot.core import commands
from redbot.core.bot import Config, Red from redbot.core.bot import Config, Red
from redbot.core.utils.chat_formatting import bold, humanize_list from redbot.core.utils.chat_formatting import humanize_list
class AntiPolls(commands.Cog): class AntiPolls(commands.Cog):
"""AntiPolls deletes messages that contain polls, with a configurable per-guild role and channel whitelist and support for default Discord permissions (Manage Messages).""" """AntiPolls deletes messages that contain polls, with a configurable per-guild role and channel whitelist and support for default Discord permissions (Manage Messages)."""
__author__ = ["[cswimr](https://www.coastalcommits.com/cswimr)"] __author__ = ["SeaswimmerTheFsh"]
__git__ = "https://www.coastalcommits.com/cswimr/SeaCogs" __version__ = "1.0.0"
__version__ = "1.0.1"
__documentation__ = "https://seacogs.coastalcommits.com/antipolls/" __documentation__ = "https://seacogs.coastalcommits.com/antipolls/"
def __init__(self, bot: Red): def __init__(self, bot: Red):
@ -39,9 +38,9 @@ class AntiPolls(commands.Cog):
n = "\n" if "\n\n" not in pre_processed else "" n = "\n" if "\n\n" not in pre_processed else ""
text = [ text = [
f"{pre_processed}{n}", f"{pre_processed}{n}",
f"{bold('Cog Version:')} [{self.__version__}]({self.__git__})", f"Cog Version: **{self.__version__}**",
f"{bold('Author:')} {humanize_list(self.__author__)}", f"Author: {humanize_list(self.__author__)}",
f"{bold('Documentation:')} {self.__documentation__}", f"Documentation: {self.__documentation__}",
] ]
return "\n".join(text) return "\n".join(text)

View file

@ -14,16 +14,15 @@ from redbot.cogs.downloader import errors
from redbot.cogs.downloader.converters import InstalledCog from redbot.cogs.downloader.converters import InstalledCog
from redbot.core import commands from redbot.core import commands
from redbot.core.bot import Red from redbot.core.bot import Red
from redbot.core.utils.chat_formatting import bold, error, humanize_list, text_to_file from redbot.core.utils.chat_formatting import error, humanize_list, text_to_file
# pylint: disable=protected-access # pylint: disable=protected-access
class Backup(commands.Cog): class Backup(commands.Cog):
"""A utility to make reinstalling repositories and cogs after migrating the bot far easier.""" """A utility to make reinstalling repositories and cogs after migrating the bot far easier."""
__author__ = ["[cswimr](https://www.coastalcommits.com/cswimr)"] __author__ = ["SeaswimmerTheFsh"]
__git__ = "https://www.coastalcommits.com/cswimr/SeaCogs" __version__ = "1.1.0"
__version__ = "1.1.1"
__documentation__ = "https://seacogs.coastalcommits.com/backup/" __documentation__ = "https://seacogs.coastalcommits.com/backup/"
def __init__(self, bot: Red): def __init__(self, bot: Red):
@ -36,9 +35,9 @@ class Backup(commands.Cog):
n = "\n" if "\n\n" not in pre_processed else "" n = "\n" if "\n\n" not in pre_processed else ""
text = [ text = [
f"{pre_processed}{n}", f"{pre_processed}{n}",
f"{bold('Cog Version:')} [{self.__version__}]({self.__git__})", f"Cog Version: **{self.__version__}**",
f"{bold('Author:')} {humanize_list(self.__author__)}", f"Author: {humanize_list(self.__author__)}",
f"{bold('Documentation:')} {self.__documentation__}", f"Documentation: {self.__documentation__}",
] ]
return "\n".join(text) return "\n".join(text)

View file

@ -8,7 +8,7 @@
"hidden": false, "hidden": false,
"disabled": false, "disabled": false,
"min_bot_version": "3.5.6", "min_bot_version": "3.5.6",
"max_bot_version": "3.5.13", "max_bot_version": "3.5.12",
"min_python_version": [3, 9, 0], "min_python_version": [3, 9, 0],
"tags": [ "tags": [
"utility", "utility",

View file

@ -15,7 +15,7 @@ from PIL import Image
from red_commons.logging import getLogger from red_commons.logging import getLogger
from redbot.core import Config, commands, data_manager from redbot.core import Config, commands, data_manager
from redbot.core.bot import Red from redbot.core.bot import Red
from redbot.core.utils.chat_formatting import bold, error, humanize_list from redbot.core.utils.chat_formatting import error, humanize_list
import bible.errors import bible.errors
from bible.models import Version from bible.models import Version
@ -24,10 +24,9 @@ from bible.models import Version
class Bible(commands.Cog): class Bible(commands.Cog):
"""Retrieve Bible verses from the API.bible API.""" """Retrieve Bible verses from the API.bible API."""
__author__ = ["[cswimr](https://www.coastalcommits.com/cswimr)"] __author__ = ["SeaswimmerTheFsh"]
__git__ = "https://www.coastalcommits.com/cswimr/SeaCogs" __version__ = "1.1.0"
__version__ = "1.1.1" __documentation__ = "https://seacogs.coastalcommits.com/bible/"
__documentation__ = "https://seacogs.coastalcommits.com/pterodactyl/"
def __init__(self, bot: Red): def __init__(self, bot: Red):
super().__init__() super().__init__()
@ -45,13 +44,12 @@ class Bible(commands.Cog):
n = "\n" if "\n\n" not in pre_processed else "" n = "\n" if "\n\n" not in pre_processed else ""
text = [ text = [
f"{pre_processed}{n}", f"{pre_processed}{n}",
f"{bold('Cog Version:')} [{self.__version__}]({self.__git__})", f"Cog Version: **{self.__version__}**",
f"{bold('Author:')} {humanize_list(self.__author__)}", f"Author: {humanize_list(self.__author__)}",
f"{bold('Documentation:')} {self.__documentation__}", f"Documentation: {self.__documentation__}",
] ]
return "\n".join(text) return "\n".join(text)
def get_icon(self, color: Colour) -> File: def get_icon(self, color: Colour) -> File:
"""Get the docs.api.bible favicon with a given color.""" """Get the docs.api.bible favicon with a given color."""
image_path = data_manager.bundled_data_path(self) / "api.bible-logo.png" image_path = data_manager.bundled_data_path(self) / "api.bible-logo.png"

View file

@ -1,4 +1,5 @@
import io import io
from typing import Any, Literal
import aiohttp import aiohttp
import discord import discord
@ -14,10 +15,9 @@ from .model import PartialEmoji
class EmojiInfo(commands.Cog): class EmojiInfo(commands.Cog):
"""Retrieve information about emojis.""" """Retrieve information about emojis."""
__author__ = ["[cswimr](https://www.coastalcommits.com/cswimr)"] __author__: list[str] = ["SeaswimmerTheFsh"]
__git__ = "https://www.coastalcommits.com/cswimr/SeaCogs" __version__: str = "1.0.0"
__version__ = "1.0.1" __documentation__: str = "https://seacogs.coastalcommits.com/emojiinfo/"
__documentation__ = "https://seacogs.coastalcommits.com/emojiinfo/"
def __init__(self, bot: Red) -> None: def __init__(self, bot: Red) -> None:
super().__init__() super().__init__()
@ -25,17 +25,16 @@ class EmojiInfo(commands.Cog):
self.logger: RedTraceLogger = getLogger(name="red.SeaCogs.Emoji") self.logger: RedTraceLogger = getLogger(name="red.SeaCogs.Emoji")
def format_help_for_context(self, ctx: commands.Context) -> str: def format_help_for_context(self, ctx: commands.Context) -> str:
pre_processed = super().format_help_for_context(ctx) or "" pre_processed: Any | Literal[''] = super().format_help_for_context(ctx) or ""
n = "\n" if "\n\n" not in pre_processed else "" n: Literal['\n'] | Literal[''] = "\n" if "\n\n" not in pre_processed else ""
text = [ text: list[str] = [
f"{pre_processed}{n}", f"{pre_processed}{n}",
f"{bold('Cog Version:')} [{self.__version__}]({self.__git__})", f"Cog Version: **{self.__version__}**",
f"{bold('Author:')} {humanize_list(self.__author__)}", f"Author: {humanize_list(items=self.__author__)}",
f"{bold('Documentation:')} {self.__documentation__}", f"Documentation: {self.__documentation__}",
] ]
return "\n".join(text) return "\n".join(text)
async def fetch_twemoji(self, unicode_emoji) -> str: async def fetch_twemoji(self, unicode_emoji) -> str:
base_url = "https://cdn.jsdelivr.net/gh/jdecked/twemoji@latest/assets/72x72/" base_url = "https://cdn.jsdelivr.net/gh/jdecked/twemoji@latest/assets/72x72/"
emoji_codepoint = "-".join([hex(ord(char))[2:] for char in unicode_emoji]) emoji_codepoint = "-".join([hex(ord(char))[2:] for char in unicode_emoji])

View file

@ -12,15 +12,13 @@ from typing import Any, Optional, Union
import discord import discord
from redbot.core import commands from redbot.core import commands
from redbot.core.utils import chat_formatting, common_filters from redbot.core.utils import chat_formatting, common_filters
from redbot.core.utils.chat_formatting import bold, humanize_list
class Nerdify(commands.Cog): class Nerdify(commands.Cog):
"""Nerdify your text.""" """Nerdify your text."""
__author__ = ["[cswimr](https://www.coastalcommits.com/cswimr)"] __author__ = ["SeaswimmerTheFsh"]
__git__ = "https://www.coastalcommits.com/cswimr/SeaCogs" __version__ = "1.3.4"
__version__ = "1.3.5"
__documentation__ = "https://seacogs.coastalcommits.com/nerdify/" __documentation__ = "https://seacogs.coastalcommits.com/nerdify/"
def __init__(self, bot): def __init__(self, bot):
@ -31,13 +29,12 @@ class Nerdify(commands.Cog):
n = "\n" if "\n\n" not in pre_processed else "" n = "\n" if "\n\n" not in pre_processed else ""
text = [ text = [
f"{pre_processed}{n}", f"{pre_processed}{n}",
f"{bold('Cog Version:')} [{self.__version__}]({self.__git__})", f"Cog Version: **{self.__version__}**",
f"{bold('Author:')} {humanize_list(self.__author__)}", f"Author: {chat_formatting.humanize_list(self.__author__)}",
f"{bold('Documentation:')} {self.__documentation__}", f"Documentation: {self.__documentation__}"
] ]
return "\n".join(text) return "\n".join(text)
@commands.command(aliases=["nerd"]) @commands.command(aliases=["nerd"])
async def nerdify( async def nerdify(
self, ctx: commands.Context, *, text: Optional[str] = None self, ctx: commands.Context, *, text: Optional[str] = None

View file

@ -46,23 +46,6 @@ class Pterodactyl(commands.Cog):
] ]
return "\n".join(text) return "\n".join(text)
async def cog_load(self) -> None:
pterodactyl_keys = await self.bot.get_shared_api_tokens("pterodactyl")
api_key = pterodactyl_keys.get("api_key")
if api_key is None:
self.task.cancel()
raise ValueError("Pterodactyl API key not set. Please set it using `[p]set api`.")
base_url = await config.base_url()
if base_url is None:
self.task.cancel()
raise ValueError("Pterodactyl base URL not set. Please set it using `[p]pterodactyl config url`.")
server_id = await config.server_id()
if server_id is None:
self.task.cancel()
raise ValueError("Pterodactyl server ID not set. Please set it using `[p]pterodactyl config serverid`.")
self.client = PterodactylClient(base_url, api_key).client
async def cog_unload(self) -> None: async def cog_unload(self) -> None:
self.update_topic.cancel() self.update_topic.cancel()
self.task.cancel() self.task.cancel()

View file

@ -38,26 +38,22 @@ def format_rfc_text(text: str, number: int) -> str:
class SeaUtils(commands.Cog): class SeaUtils(commands.Cog):
"""A collection of random utilities.""" """A collection of random utilities."""
__author__ = ["[cswimr](https://www.coastalcommits.com/cswimr)"] __author__ = ["SeaswimmerTheFsh"]
__git__ = "https://www.coastalcommits.com/cswimr/SeaCogs" __version__ = "1.0.0"
__version__ = "1.0.1"
__documentation__ = "https://seacogs.coastalcommits.com/seautils/"
def __init__(self, bot: Red) -> None: def __init__(self, bot: Red) -> None:
self.bot = bot self.bot = bot
def format_help_for_context(self, ctx: commands.Context) -> str: def format_help_for_context(self, ctx: commands.Context) -> str:
pre_processed = super().format_help_for_context(ctx) or "" pre_processed = super().format_help_for_context(ctx=ctx) or ""
n = "\n" if "\n\n" not in pre_processed else "" n = "\n" if "\n\n" not in pre_processed else ""
text = [ text = [
f"{pre_processed}{n}", f"{pre_processed}{n}",
f"{cf.bold('Cog Version:')} [{self.__version__}]({self.__git__})", f"Cog Version: **{self.__version__}**",
f"{cf.bold('Author:')} {cf.humanize_list(self.__author__)}", f"Author: {cf.humanize_list(items=self.__author__)}"
f"{cf.bold('Documentation:')} {self.__documentation__}",
] ]
return "\n".join(text) return "\n".join(text)
def format_src(self, obj: Any) -> str: def format_src(self, obj: Any) -> str:
"""A large portion of this code is repurposed from Zephyrkul's RTFS cog. """A large portion of this code is repurposed from Zephyrkul's RTFS cog.
https://github.com/Zephyrkul/FluffyCogs/blob/master/rtfs/rtfs.py""" https://github.com/Zephyrkul/FluffyCogs/blob/master/rtfs/rtfs.py"""