Home¶
Welcome to the documentation for the Tidegear project! Tidegear is a Python module that contains a wide variety of useful functionality and utilities, meant for use in Red-DiscordBot cogs. Please see the list of pages on the left for more comprehensive documentation.
Version Guarantees¶
Tidegear uses a major.minor.patch release versioning scheme.
For versions prior to 1.29.0, major was largely unused, and breaking changes were regularly put under minor version numbers.
As of 1.29.0 and 2.0.0 however, Tidegear will now properly mark any breaking change as a major version bump.
This means that you should be pinning Tidegear versions like so: red-tidegear~=2.0
That will install all future versions of 2.x.x, but will not install 3.x.x.
It is effectively equivalent to red-tidegear>=2.0.0,<3.0.0.
You should probably not pin Tidegear like this: red-tidegear~=2.0.0.
This will result in only future 2.0.x versions being installed, and is probably not what you want.
This would be equivalent to red-tidegear>=2.0.0,<2.1.0.
Example Usage¶
This section will go over some uses of Tidegear.
Cog Boilerplate¶
from redbot.core import commands
from redbot.core.bot import Red
from tidegear import Cog
class ExampleCog(Cog):
"""Your first Tidegear cog."""
def __init__(self, bot: Red) -> None:
super().__init__(bot)
@commands.command()
async def hello(self, ctx: commands.Context) -> None:
await ctx.send(f"Hello from {self.metadata.name}!")
from redbot.core.bot import Red
from .examplecog import ExampleCog
async def setup(bot: Red) -> None:
await bot.add_cog(ExampleCog(bot))
{
"$schema": "https://c.csw.im/cswimr/tidegear/raw/branch/main/schema/meta/meta.json",
"version": "0.1.0",
"repository": {
"owner": "change-me",
"name": "example-cog-repository",
"url": "https://example.com/change-me/example-cog-repository"
},
"authors": [
{
"name": "change-me",
"url": "https://example.com/change-me"
}
]
}
Shipping Application Emojis¶
To add application emojis to your cog, create a new folder in your cog's data directory named emojis.
For our examplecog cog, the path for emojis would be examplecog/data/emojis/.
Then, drag any image or animated image file that you'd like to use as an emoji into the folder.
After reloading your cog, Tidegear should upload your emoji to Discord.
You can access your cog's uploaded emojis through self.get_application_emoji.