-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# SPDX-License-Identifier: MIT | ||
"""An example plugin cog. | ||
This cog is an example of how to create a plugin cog. | ||
It is ignored and cannot be loaded by the bot. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
import nextcord | ||
from nextcord.ext import commands | ||
from nextcord.interactions import Interaction | ||
|
||
if TYPE_CHECKING: | ||
from sggwbot.sggw_bot import SGGWBot | ||
|
||
|
||
class ExampleCog(commands.Cog): | ||
"""An example plugin cog.""" | ||
|
||
__slots__ = ("bot",) | ||
|
||
_bot: SGGWBot | ||
|
||
def __init__(self, bot: SGGWBot): | ||
self._bot = bot | ||
|
||
@nextcord.slash_command(name="example", description="Example command") | ||
async def _example(self, interaction: Interaction) -> None: | ||
await interaction.response.send_message("Hello, world!", ephemeral=True) | ||
|
||
|
||
def setup(bot: SGGWBot): | ||
"""Loads the ExampleCog cog.""" | ||
bot.add_cog(ExampleCog(bot)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"enabled": true | ||
} |