Skip to content

Commit

Permalink
Initial revision
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreusada committed Nov 20, 2024
1 parent 9f8a7ba commit fd9f6b3
Show file tree
Hide file tree
Showing 33 changed files with 186 additions and 275 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ __pycache__/
.venv/
venv/
docgen.py
_build/
5 changes: 4 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
version: 2

build:
image: "latest"

sphinx:
configuration: docs/conf.py

python:
version: 3.8
version: "3.9"
install:
- requirements: docs/requirements.txt
56 changes: 0 additions & 56 deletions README.es.rst

This file was deleted.

39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
![Kreusada Cogs Artwork](.github/resources/kreusadacogs-artwork.png)

# Cogs for Red-DiscordBot authored by Kreusada

Hello, these are the third party cogs I created for Red-DiscordBot.

## Installation

Primarily, make sure you have `downloader` loaded.

```
[p]load downloader
```

Next, let's add my repository to your system.

```
[p]repo add kreusada https://github.com/Kreusada/Kreusada-Cogs
```

To install a cog, use this command, replacing `<cog>` with the name of the cog you wish to install:

```
[p]cog install kreusada <cog>
```

## Available Cogs List

Please see [here](https://github.com/Kreusada/Kreusada-Cogs/blob/master/cogs.csv) for the list of available cogs. Cogs get added and removed without notice.

## Supporting My Work

If you appreciate my work or would like to donate, I use [Ko-Fi](https://ko-fi.com/kreusada)!

## Support

Check out my docs [here](https://kreusadacogs.readthedocs.io/en/latest/).
Mention me in the `#support_kreusada-cogs` channel in the [cog support server](https://discord.gg/GET4DVk) if you need any help.
You can also join my [personal server](https://discord.gg/JmCFyq7) if you wish!
57 changes: 0 additions & 57 deletions README.rst

This file was deleted.

24 changes: 13 additions & 11 deletions cocktail/cocktail.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,25 @@ async def callback(self, interaction: discord.Interaction):
await interaction.response.send_message(message, ephemeral=True)
await self.view.message.edit(view=self.view, embed=embed)

async def on_timeout(self):
self.disabled = True
await self.view.message.edit(view=self.view)


class CocktailView(discord.ui.View):
def __init__(self, *, cog: Cocktail, cocktail: str, favourite: bool):
def __init__(self, ctx: commands.Context, cocktail: str, favourite: bool):
super().__init__()
self.message: discord.Message
self.ctx = ctx
self.add_item(
CocktailFavouriteButton(cog=cog, cocktail=cocktail, favourite=favourite)
CocktailFavouriteButton(cog=ctx.cog, cocktail=cocktail, favourite=favourite)
)

async def interaction_check(self, interaction: discord.Interaction):
if interaction.user.id != self.message.author.id:
await interaction.response.send_message("Invoke the command yourself to add it to your favourites.", ephemeral=True)
async def on_timeout(self):
for children in self.children:
children.disabled = True
await self.message.edit(view=self.view)

async def interaction_check(self, interaction: discord.Interaction):
if self.ctx.author.id != interaction.user.id:
return interaction.response.send_message("Invoke the command yourself to add/remove from favourites!", ephemeral=True)
return True

class Cocktail(commands.Cog):
"""Get information about different cocktails and their ingredients."""
Expand All @@ -79,7 +81,7 @@ def __init__(self, bot: Red):
self.config.register_user(favourites=[])

__author__ = "Kreusada"
__version__ = "1.0.2"
__version__ = "1.1.0"

def format_help_for_context(self, ctx: commands.Context) -> str:
context = super().format_help_for_context(ctx)
Expand Down Expand Up @@ -144,7 +146,7 @@ async def cocktail(self, ctx: commands.Context, *, name: str):
name="Ingredients", value="\n".join(f"- {x}" for x in ingredients)
)

view = CocktailView(cog=self, cocktail=drink["strDrink"], favourite=favourite)
view = CocktailView(ctx, cocktail=drink["strDrink"], favourite=favourite)
view.message = await ctx.send(embed=embed, view=view)

@cocktail.command()
Expand Down
4 changes: 2 additions & 2 deletions cogpaths/cogpaths.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CogPaths(commands.Cog):
"""Get information about a cog's paths."""

__author__ = "Kreusada"
__version__ = "1.1.0"
__version__ = "1.2.0"

def __init__(self, bot: Red):
self.bot = bot
Expand All @@ -34,7 +34,7 @@ async def cogpath(self, ctx: commands.Context, cog: CogConverter):
if not os.path.exists(cog_data_path):
cog_data_path = None
if not isinstance(getattr(cog, "config", None), Config):
reason = "This cog does not store any data, or does not use Red's Config API."
reason = "This cog does not store any data, does not use the `.config` attribute, or does not use Red's Config API."
else:
reason = "This cog had its data directory removed."
message = "Cog path: {}\nData path: {}".format(cog_path, cog_data_path or reason)
Expand Down
2 changes: 1 addition & 1 deletion colour/colour.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def colour(self, ctx: commands.Context, colour: HexCodeConverter):
"""
async with aiohttp.ClientSession() as session:
async with session.get(
f"https://www.thecolorapi.com/id?hex={str(colour)[1:]}"
f"https://www.thecolorapi.com/id?hex={str(colour)[1:]}", ssl=False
) as request:
data = await request.json()
if data["name"]["exact_match_name"]:
Expand Down
4 changes: 4 additions & 0 deletions docs/_static/black_doc_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
def func(): print ("Hello world!")

def func_2():
if(True): print("Hello"+ "World" , "!", sep = '')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/examples/blackformatter/black1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/examples/cocktail/cocktail0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/examples/cocktail/cocktail1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/examples/cogpaths/cogpath0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/examples/colour/colour0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/examples/flags/flag0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/examples/flags/flag1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion docs/_templates/relations.html

This file was deleted.

5 changes: 3 additions & 2 deletions docs/cog_riddles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ Commands

Here are all the commands included in this cog (1):

* ``[p]riddle``
Get a random riddle.
Command Help
------------- --------------------
``[p]riddle`` Get a random riddle.

------------
Installation
Expand Down
Loading

0 comments on commit fd9f6b3

Please sign in to comment.