mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Music tunneling (#7)
* New requirement * SMall fixes for tunnel * First step towards cogization * Tmp chng * Testing of new functions in conjurer_musician.py and radio_conjurer.liq * Fixes! * Fix fix * Mostly working ? * Requests * Fixes * Fix * Radio requests * Radio hardkor * Fix * Fixes * Change log to print * Clearing fetch failed * Small fix * sx * Fix fix fix * test * el fixo stupido * test * Maybe fix ? * FIX! * Fix fix fix * FIx of volume
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
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*"
|
||||
)
|
||||
Reference in New Issue
Block a user