-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathsource.py
More file actions
33 lines (24 loc) · 1.11 KB
/
source.py
File metadata and controls
33 lines (24 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""Contains cog classes for any source interactions."""
from typing import TYPE_CHECKING
import discord
from utils import TeXBotBaseCog
if TYPE_CHECKING:
from collections.abc import Sequence
from utils import TeXBotApplicationContext
__all__: "Sequence[str]" = ("SourceCommandCog",)
class SourceCommandCog(TeXBotBaseCog):
"""Cog class that defines the "/source" command and its call-back method."""
@discord.slash_command(
description="Displays information about the source code of TeX-Bot."
)
async def source(self, ctx: "TeXBotApplicationContext") -> None:
"""Definition & callback response of the "source" command."""
await ctx.respond(
(
f"{self.bot.user.mention if self.bot.user else '**`@TeX-Bot`**'} "
"is an open-source project, "
"originally made to help manage [the UoB CSS Discord server](https://cssbham.com/discord)!\n"
"You can see and contribute to the source code at [CSSUoB/TeX-Bot-Py-V2](https://github.com/CSSUoB/TeX-Bot-Py-V2)."
),
ephemeral=True,
)