mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
ef6eb84921
Snapshot of the dockerisation-era bot code laid out at the repository root so it can be diffed directly against the working-copy baseline (restructure/working-copy-root) to see how the variant differed: - thin_client.py asyncio entrypoint (vs working_copy bot.py) - constants.py env-var/credential refactor, communication auth, etc. - extra gpt_interface/ service, sync.py, watch_script_params.py - conanjurer_* modules absent in this variant Docker infrastructure (docker/, docker-compose.yml, .dockerignore) intentionally omitted - this branch is for code comparison only and is not intended to be merged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
47 lines
2.0 KiB
Python
47 lines
2.0 KiB
Python
import discord
|
|
from discord.ext import commands
|
|
from typing import Optional
|
|
|
|
class Music(commands.Cog):
|
|
def __init__(self, bot):
|
|
self.bot = bot # This is so you can access Bot instance in your cog
|
|
|
|
# You must have this function for `bot.load_extension` to call
|
|
def setup(bot):
|
|
bot.add_cog(Music(bot))
|
|
|
|
@commands.hybrid_command(
|
|
name="przytul", description="Przytul kogoś - daj mention po komendzie :)"
|
|
)
|
|
async def przytul(ctx, arg: Optional[discord.Member] = None):
|
|
"""
|
|
Generate a text about hugging mentioned user.
|
|
|
|
:param ctx: ctx stands for "context" and is a required parameter in Discord.py commands. It
|
|
represents the context in which the command was invoked, including information such as the message,
|
|
the channel, the server, and the user who invoked the command
|
|
:param arg: arg is a parameter of the function "przytul" that expects a Discord member object. The
|
|
parameter is optional, meaning that if no member object is provided, it will default to None
|
|
:type arg: Optional[discord.Member]
|
|
"""
|
|
async with ctx.typing():
|
|
nieprzytulac = False
|
|
for mention in ctx.message.mentions:
|
|
for role in mention.roles:
|
|
if role.name == "NIEPRZYTULAĆ!":
|
|
nieprzytulac = True
|
|
|
|
if arg and nieprzytulac:
|
|
await ctx.send(
|
|
f"Żebym ja Ciebie nie przytulił {ctx.message.author.mention}"
|
|
)
|
|
elif arg:
|
|
await ctx.send(
|
|
# trunk-ignore(codespell/misspelled)
|
|
f"Już dobrze.... Już dobrze... Ojej.. Biedactwo... :( *W ułamku sekundy {arg.mention} znajduje sie w duszącym uścisku. Żebra trzeszczą - kilka pęka. Pacnięcia po plecach grożą odbiciem nerek, a głaskanie po głowie powoduje wstrząs mózgu*"
|
|
)
|
|
else:
|
|
await ctx.send(
|
|
"Kogo mam przytulić? *Wyłamuje kostki i przeciąga się - jego 200 kilowa sylwetka złożona z samych mięśni świadczy o tym że jest gotowy*"
|
|
)
|