feat: Implement bidirectional usage counts for roleplay commands and add pluralization helper

This commit is contained in:
Slipstream 2025-05-27 15:04:23 -06:00
parent 8cbe6955bc
commit 1b26459db0
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD
2 changed files with 192 additions and 92 deletions

View File

@ -14,6 +14,10 @@ class MessageCog(commands.Cog):
{target} - Your pants are slowly and deliberately removed, leaving you feeling exposed and vulnerable. The sensation is both thrilling and terrifying as a presence looms over you, the only sound being the faint rustling of fabric as your clothes are discarded.
"""
def plural(self, word, count, suffix="s"):
"""Helper function to correctly pluralize words based on count."""
return f"{word}{suffix if count != 1 else ''}"
async def _ensure_usage_table_exists(self):
"""Ensure the command usage counters table exists."""
if not hasattr(self.bot, 'pg_pool') or not self.bot.pg_pool:
@ -69,6 +73,35 @@ class MessageCog(commands.Cog):
log.error(f"Error getting usage count: {e}")
return 0
async def _get_bidirectional_usage_counts(self, user1_id: int, user2_id: int, command_name: str) -> tuple[int, int]:
"""Get the usage counts for a command in both directions between two users.
Returns:
tuple[int, int]: (user1_to_user2_count, user2_to_user1_count)
"""
if not await self._ensure_usage_table_exists():
return 0, 0
try:
async with self.bot.pg_pool.acquire() as conn:
# Get count for user1 -> user2
count_1_to_2 = await conn.fetchval("""
SELECT usage_count FROM command_usage_counters
WHERE user1_id = $1 AND user2_id = $2 AND command_name = $3
""", user1_id, user2_id, command_name)
# Get count for user2 -> user1
count_2_to_1 = await conn.fetchval("""
SELECT usage_count FROM command_usage_counters
WHERE user1_id = $1 AND user2_id = $2 AND command_name = $3
""", user2_id, user1_id, command_name)
return (count_1_to_2 if count_1_to_2 is not None else 0,
count_2_to_1 if count_2_to_1 is not None else 0)
except Exception as e:
log.error(f"Error getting bidirectional usage counts: {e}")
return 0, 0
# Helper method for the message logic
async def _message_logic(self, target):
"""Core logic for the message command."""
@ -87,11 +120,13 @@ class MessageCog(commands.Cog):
# Track usage between the two users
await self._increment_usage_counter(interaction.user.id, member.id, "molest")
# Get the updated count
count = await self._get_usage_count(interaction.user.id, member.id, "molest")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(interaction.user.id, member.id, "molest")
response = await self._message_logic(member.mention)
response += f"\n-# {interaction.user.display_name} and {member.display_name} have molested {count} times"
response += f"\n-# {interaction.user.display_name} has molested {member.display_name} {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} has molested {interaction.user.display_name} {target_to_caller} {self.plural('time', target_to_caller)}"
await interaction.response.send_message(response)
@commands.command(name="molest")
@ -100,11 +135,13 @@ class MessageCog(commands.Cog):
# Track usage between the two users
await self._increment_usage_counter(ctx.author.id, member.id, "molest")
# Get the updated count
count = await self._get_usage_count(ctx.author.id, member.id, "molest")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(ctx.author.id, member.id, "molest")
response = await self._message_logic(member.mention)
response += f"\n-# {ctx.author.display_name} and {member.display_name} have molested {count} times"
response += f"\n-# {ctx.author.display_name} has molested {member.display_name} {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} has molested {ctx.author.display_name} {target_to_caller} {self.plural('time', target_to_caller)}"
await ctx.reply(response)
@rp.command(name="rape", description="Sends a message stating the author raped the mentioned user.")
@ -116,8 +153,8 @@ class MessageCog(commands.Cog):
# Track usage between the two users
await self._increment_usage_counter(interaction.user.id, member.id, "rape")
# Get the updated count
count = await self._get_usage_count(interaction.user.id, member.id, "rape")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(interaction.user.id, member.id, "rape")
rape_messages = [
f"{interaction.user.mention} raped {member.mention}.",
@ -133,7 +170,9 @@ class MessageCog(commands.Cog):
f"{interaction.user.mention} left {member.mention} traumatized after the assault."
]
response = random.choice(rape_messages)
response += f"\n-# {interaction.user.display_name} has raped {member.display_name} {count} times"
response += f"\n-# {interaction.user.display_name} has raped {member.display_name} {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} has raped {interaction.user.display_name} {target_to_caller} {self.plural('time', target_to_caller)}"
await interaction.response.send_message(response)
@commands.command(name="rape")
@ -142,8 +181,8 @@ class MessageCog(commands.Cog):
# Track usage between the two users
await self._increment_usage_counter(ctx.author.id, member.id, "rape")
# Get the updated count
count = await self._get_usage_count(ctx.author.id, member.id, "rape")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(ctx.author.id, member.id, "rape")
rape_messages = [
f"{ctx.author.mention} raped {member.mention}.",
@ -301,7 +340,9 @@ class MessageCog(commands.Cog):
f"{member.mention} was a victim of {ctx.author.mention}'s utterly depraved, evil, monstrous, and truly unspeakable mind."
]
response = random.choice(rape_messages)
response += f"\n-# {ctx.author.display_name} has raped {member.display_name} {count} times"
response += f"\n-# {ctx.author.display_name} has raped {member.display_name} {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} has raped {ctx.author.display_name} {target_to_caller} {self.plural('time', target_to_caller)}"
await ctx.reply(response)
@rp.command(name="sex", description="Send a normal sex message to the mentioned user")
@ -342,11 +383,13 @@ class MessageCog(commands.Cog):
f"{member.mention} felt a deep connection with {interaction.user.mention} during their encounter.",
f"{interaction.user.mention} and {member.mention} experienced mutual pleasure."
]
# Get the updated count
count = await self._get_usage_count(interaction.user.id, member.id, "sex")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(interaction.user.id, member.id, "sex")
response = random.choice(sex_messages)
response += f"\n-# {interaction.user.display_name} and {member.display_name} have had sex {count} times"
response += f"\n-# {interaction.user.display_name} and {member.display_name} have had sex {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} and {interaction.user.display_name} have had sex {target_to_caller} {self.plural('time', target_to_caller)}"
await interaction.response.send_message(response)
@commands.command(name="sex")
@ -355,8 +398,8 @@ class MessageCog(commands.Cog):
# Track usage between the two users
await self._increment_usage_counter(ctx.author.id, member.id, "sex")
# Get the updated count
count = await self._get_usage_count(ctx.author.id, member.id, "sex")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(ctx.author.id, member.id, "sex")
sex_messages = [
f"{ctx.author.mention} and {member.mention} shared a tender kiss that deepened into a passionate embrace.",
@ -384,11 +427,13 @@ class MessageCog(commands.Cog):
f"{member.mention} was pleasured by {ctx.author.mention}.",
f"{ctx.author.mention} and {member.mention} shared an intimate moment.",
f"{ctx.author.mention} and {member.mention} explored their desires.",
f"{member.mention} felt a deep connection with {ctx.author.mention} during their encounter.",
f"{member.author.mention} felt a deep connection with {ctx.author.mention} during their encounter.",
f"{ctx.author.mention} and {member.mention} experienced mutual pleasure."
]
response = random.choice(sex_messages)
response += f"\n-# {ctx.author.display_name} and {member.display_name} have had sex {count} times"
response += f"\n-# {ctx.author.display_name} and {member.display_name} have had sex {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} and {ctx.author.display_name} have had sex {target_to_caller} {self.plural('time', target_to_caller)}"
await ctx.reply(response)
@rp.command(name="headpat", description="Send a wholesome headpat message to the mentioned user")
@ -400,6 +445,9 @@ class MessageCog(commands.Cog):
# Track usage between the two users
await self._increment_usage_counter(interaction.user.id, member.id, "headpat")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(interaction.user.id, member.id, "headpat")
headpat_messages = [
f"{interaction.user.mention} gently pats {member.mention}'s head, a soft smile gracing their lips.",
f"{interaction.user.mention} reaches out and gives {member.mention} a comforting headpat.",
@ -471,25 +519,25 @@ class MessageCog(commands.Cog):
f"{interaction.user.mention} gives {member.mention} a headpat, a tender expression of understanding.",
f"{interaction.user.mention} gives {member.mention} a headpat, a comforting gesture of happiness.",
f"{interaction.user.mention} gives {member.mention} a headpat, a sweet and gentle caress.",
f"{interaction.user.mention} gives {member.mention} a headpat, a loving moment of warmth.",
f"{interaction.user.mention} gives {member.mention} a headpat, a tender touch that brings joy.",
f"{interaction.user.mention} gives {member.mention} a headpat, a sweet gesture of comfort.",
f"{interaction.user.mention} gives {member.mention} a headpat, a gentle caress that brings peace.",
f"{interaction.user.mention} gives {member.mention} a headpat, a loving touch that brings happiness.",
f"{interaction.user.mention} gives {member.mention} a headpat, a tender expression of solace.",
f"{interaction.user.mention} gives {member.mention} a headpat, a comforting gesture of joy.",
f"{interaction.user.mention} gives {member.mention} a headpat, a sweet and gentle touch that reassures.",
f"{interaction.user.mention} gives {member.mention} a headpat, a loving moment of understanding.",
f"{interaction.user.mention} gives {member.mention} a headpat, a tender touch that brings comfort.",
f"{interaction.user.mention} gives {member.mention} a headpat, a sweet gesture of peace.",
f"{interaction.user.mention} gives {member.mention} a headpat, a gentle caress that brings happiness.",
f"{interaction.user.mention} gives {member.mention} a headpat, a loving touch that brings solace.",
f"{interaction.user.mention} gives {member.mention} a headpat, a tender expression of joy.",
f"{interaction.user.mention} gives {member.mention} a headpat, a comforting gesture of peace.",
f"{interaction.user.mention} gives {member.mention} a headpat, a sweet and gentle moment of happiness.",
f"{interaction.user.mention} gives {member.mention} a headpat, a loving touch that brings comfort.",
f"{interaction.user.mention} gives {member.mention} a headpat, a tender caress that brings peace.",
f"{interaction.user.mention} gives {member.mention} a headpat, a sweet gesture of happiness.",
f"{interaction.user.mention} gives {member.mention} a loving moment of warmth.",
f"{interaction.user.mention} gives {member.mention} a tender touch that brings joy.",
f"{interaction.user.mention} gives {member.mention} a sweet gesture of comfort.",
f"{interaction.user.mention} gives {member.mention} a gentle caress that brings peace.",
f"{interaction.user.mention} gives {member.mention} a loving touch that brings happiness.",
f"{interaction.user.mention} gives {member.mention} a tender expression of solace.",
f"{interaction.user.mention} gives {member.mention} a comforting gesture of joy.",
f"{interaction.user.mention} gives {member.mention} a sweet and gentle touch that reassures.",
f"{interaction.user.mention} gives {member.mention} a loving moment of understanding.",
f"{interaction.user.mention} gives {member.mention} a tender touch that brings comfort.",
f"{interaction.user.mention} gives {member.mention} a sweet gesture of peace.",
f"{interaction.user.mention} gives {member.mention} a gentle caress that brings happiness.",
f"{interaction.user.mention} gives {member.mention} a loving touch that brings solace.",
f"{interaction.user.mention} gives {member.mention} a tender expression of joy.",
f"{interaction.user.mention} gives {member.mention} a comforting gesture of peace.",
f"{interaction.user.mention} gives {member.mention} a sweet and gentle moment of happiness.",
f"{interaction.user.mention} gives {member.mention} a loving touch that brings comfort.",
f"{interaction.user.mention} gives {member.mention} a tender caress that brings peace.",
f"{interaction.user.mention} gives {member.mention} a sweet gesture of happiness.",
f"{interaction.user.mention} gives {member.mention} a gentle touch that brings solace.",
f"{interaction.user.mention} gives {member.mention} a loving caress that brings joy.",
f"{interaction.user.mention} gives {member.mention} a tender expression of peace.",
@ -611,11 +659,13 @@ class MessageCog(commands.Cog):
f"{interaction.user.mention} gives {member.mention} a headpat, a tender gesture of pure, unadulterated, and boundless love.",
f"{interaction.user.mention} gives {member.mention} a headpat, a sweet moment of absolute, serene, and perfect tranquility.",
]
# Get the updated count
count = await self._get_usage_count(interaction.user.id, member.id, "headpat")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(interaction.user.id, member.id, "headpat")
response = random.choice(headpat_messages)
response += f"\n-# {interaction.user.display_name} and {member.display_name} have headpatted {count} times"
response += f"\n-# {interaction.user.display_name} has headpatted {member.display_name} {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} has headpatted {interaction.user.display_name} {target_to_caller} {self.plural('time', target_to_caller)}"
await interaction.response.send_message(response)
@commands.command(name="headpat")
@ -624,8 +674,8 @@ class MessageCog(commands.Cog):
# Track usage between the two users
await self._increment_usage_counter(ctx.author.id, member.id, "headpat")
# Get the updated count
count = await self._get_usage_count(ctx.author.id, member.id, "headpat")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(ctx.author.id, member.id, "headpat")
headpat_messages = [
f"{ctx.author.mention} gently pats {member.mention}'s head, a soft smile gracing their lips.",
@ -838,11 +888,10 @@ class MessageCog(commands.Cog):
f"{ctx.author.mention} gives {member.mention} a headpat, a tender gesture of pure, unadulterated, and boundless love.",
f"{ctx.author.mention} gives {member.mention} a headpat, a sweet moment of absolute, serene, and perfect tranquility.",
]
# Get the updated count
count = await self._get_usage_count(ctx.author.id, member.id, "headpat")
response = random.choice(headpat_messages)
response += f"\n-# {ctx.author.display_name} and {member.display_name} have headpatted {count} times"
response += f"\n-# {ctx.author.display_name} has headpatted {member.display_name} {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} has headpatted {ctx.author.display_name} {target_to_caller} {self.plural('time', target_to_caller)}"
await ctx.reply(response)
# --- Memes Group ---

View File

@ -10,6 +10,10 @@ class MessageCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
def plural(self, word, count, suffix="s"):
"""Helper function to correctly pluralize words based on count."""
return f"{word}{suffix if count != 1 else ''}"
async def _ensure_usage_table_exists(self):
"""Ensure the command usage counters table exists."""
if not hasattr(self.bot, 'pg_pool') or not self.bot.pg_pool:
@ -65,6 +69,35 @@ class MessageCog(commands.Cog):
log.error(f"Error getting usage count: {e}")
return 0
async def _get_bidirectional_usage_counts(self, user1_id: int, user2_id: int, command_name: str) -> tuple[int, int]:
"""Get the usage counts for a command in both directions between two users.
Returns:
tuple[int, int]: (user1_to_user2_count, user2_to_user1_count)
"""
if not await self._ensure_usage_table_exists():
return 0, 0
try:
async with self.bot.pg_pool.acquire() as conn:
# Get count for user1 -> user2
count_1_to_2 = await conn.fetchval("""
SELECT usage_count FROM command_usage_counters
WHERE user1_id = $1 AND user2_id = $2 AND command_name = $3
""", user1_id, user2_id, command_name)
# Get count for user2 -> user1
count_2_to_1 = await conn.fetchval("""
SELECT usage_count FROM command_usage_counters
WHERE user1_id = $1 AND user2_id = $2 AND command_name = $3
""", user2_id, user1_id, command_name)
return (count_1_to_2 if count_1_to_2 is not None else 0,
count_2_to_1 if count_2_to_1 is not None else 0)
except Exception as e:
log.error(f"Error getting bidirectional usage counts: {e}")
return 0, 0
# --- RP Group ---
rp = app_commands.Group(name="rp", description="Roleplay commands")
@ -105,11 +138,13 @@ class MessageCog(commands.Cog):
f"{member.mention} felt an intense connection with {interaction.user.mention} during their explicit encounter.",
f"{interaction.user.mention} and {member.mention} experienced explosive mutual pleasure."
]
# Get the updated count
count = await self._get_usage_count(interaction.user.id, member.id, "neru_sex")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(interaction.user.id, member.id, "neru_sex")
response = random.choice(sex_messages)
response += f"\n-# {interaction.user.display_name} and {member.display_name} have had sex {count} times"
response += f"\n-# {interaction.user.display_name} and {member.display_name} have had sex {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} and {interaction.user.display_name} have had sex {target_to_caller} {self.plural('time', target_to_caller)}"
await interaction.response.send_message(response)
@commands.command(name="sex")
@ -118,8 +153,8 @@ class MessageCog(commands.Cog):
# Track usage between the two users
await self._increment_usage_counter(ctx.author.id, member.id, "neru_sex")
# Get the updated count
count = await self._get_usage_count(ctx.author.id, member.id, "neru_sex")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(ctx.author.id, member.id, "neru_sex")
sex_messages = [
f"{ctx.author.mention} roughly pins {member.mention} against the wall, their lips crashing together in a desperate, hungry kiss.",
@ -150,7 +185,9 @@ class MessageCog(commands.Cog):
f"{ctx.author.mention} and {member.mention} experienced explosive mutual pleasure."
]
response = random.choice(sex_messages)
response += f"\n-# {ctx.author.display_name} and {member.display_name} have had sex {count} times"
response += f"\n-# {ctx.author.display_name} and {member.display_name} have had sex {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} and {ctx.author.display_name} have had sex {target_to_caller} {self.plural('time', target_to_caller)}"
await ctx.reply(response)
@rp.command(name="rape", description="Sends a message stating the author raped the mentioned user.")
@ -321,11 +358,13 @@ class MessageCog(commands.Cog):
f"{interaction.user.mention} reveled in the total, complete, absolute, and utter annihilation of {member.mention}, leaving nothing but ruin.",
f"{member.mention} was a victim of {interaction.user.mention}'s utterly depraved, evil, monstrous, and truly unspeakable mind."
]
# Get the updated count
count = await self._get_usage_count(interaction.user.id, member.id, "neru_rape")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(interaction.user.id, member.id, "neru_rape")
response = random.choice(rape_messages)
response += f"\n-# {interaction.user.display_name} has raped {member.display_name} {count} times"
response += f"\n-# {interaction.user.display_name} has raped {member.display_name} {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} has raped {interaction.user.display_name} {target_to_caller} {self.plural('time', target_to_caller)}"
await interaction.response.send_message(response)
@rp.command(name="kiss", description="Send a wholesome kiss message to the mentioned user")
@ -359,11 +398,13 @@ class MessageCog(commands.Cog):
f"{interaction.user.mention} kisses {member.mention} under the starlight.",
f"{interaction.user.mention} gives {member.mention} a goodnight kiss.",
]
# Get the updated count
count = await self._get_usage_count(interaction.user.id, member.id, "neru_kiss")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(interaction.user.id, member.id, "neru_kiss")
response = random.choice(kiss_messages)
response += f"\n-# {interaction.user.display_name} and {member.display_name} have kissed {count} times"
response += f"\n-# {interaction.user.display_name} and {member.display_name} have kissed {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} and {interaction.user.display_name} have kissed {target_to_caller} {self.plural('time', target_to_caller)}"
await interaction.response.send_message(response)
@commands.command(name="kiss")
@ -372,8 +413,8 @@ class MessageCog(commands.Cog):
# Track usage between the two users
await self._increment_usage_counter(ctx.author.id, member.id, "neru_kiss")
# Get the updated count
count = await self._get_usage_count(ctx.author.id, member.id, "neru_kiss")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(ctx.author.id, member.id, "neru_kiss")
kiss_messages = [
f"{ctx.author.mention} gives {member.mention} a sweet kiss on the cheek.",
@ -388,7 +429,9 @@ class MessageCog(commands.Cog):
f"{ctx.author.mention} kisses {member.mention} with a smile.",
]
response = random.choice(kiss_messages)
response += f"\n-# {ctx.author.display_name} and {member.display_name} have kissed {count} times"
response += f"\n-# {ctx.author.display_name} and {member.display_name} have kissed {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} and {ctx.author.display_name} have kissed {target_to_caller} {self.plural('time', target_to_caller)}"
await ctx.reply(response)
@rp.command(name="hug", description="Send a wholesome hug message to the mentioned user")
@ -422,11 +465,13 @@ class MessageCog(commands.Cog):
f"{interaction.user.mention} gives {member.mention} a healing hug that makes everything better.",
f"{interaction.user.mention} and {member.mention} share a moment in a tender embrace.",
]
# Get the updated count
count = await self._get_usage_count(interaction.user.id, member.id, "neru_hug")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(interaction.user.id, member.id, "neru_hug")
response = random.choice(hug_messages)
response += f"\n-# {interaction.user.display_name} and {member.display_name} have hugged {count} times"
response += f"\n-# {interaction.user.display_name} and {member.display_name} have hugged {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} and {interaction.user.display_name} have hugged {target_to_caller} {self.plural('time', target_to_caller)}"
await interaction.response.send_message(response)
@commands.command(name="hug")
@ -435,8 +480,8 @@ class MessageCog(commands.Cog):
# Track usage between the two users
await self._increment_usage_counter(ctx.author.id, member.id, "neru_hug")
# Get the updated count
count = await self._get_usage_count(ctx.author.id, member.id, "neru_hug")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(ctx.author.id, member.id, "neru_hug")
hug_messages = [
f"{ctx.author.mention} gives {member.mention} a warm hug.",
@ -451,7 +496,9 @@ class MessageCog(commands.Cog):
f"{ctx.author.mention} and {member.mention} share a sweet hug.",
]
response = random.choice(hug_messages)
response += f"\n-# {ctx.author.display_name} and {member.display_name} have hugged {count} times"
response += f"\n-# {ctx.author.display_name} and {member.display_name} have hugged {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} and {ctx.author.display_name} have hugged {target_to_caller} {self.plural('time', target_to_caller)}"
await ctx.reply(response)
@rp.command(name="headpat", description="Send a wholesome headpat message to the mentioned user")
@ -775,11 +822,13 @@ class MessageCog(commands.Cog):
f"{interaction.user.mention} gives {member.mention} a headpat, a tender gesture of pure, unadulterated, and boundless love.",
f"{interaction.user.mention} gives {member.mention} a headpat, a sweet moment of absolute, serene, and perfect tranquility.",
]
# Get the updated count
count = await self._get_usage_count(interaction.user.id, member.id, "neru_headpat")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(interaction.user.id, member.id, "neru_headpat")
response = random.choice(headpat_messages)
response += f"\n-# {interaction.user.display_name} and {member.display_name} have headpatted {count} times"
response += f"\n-# {interaction.user.display_name} and {member.display_name} have headpatted {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} and {interaction.user.display_name} have headpatted {target_to_caller} {self.plural('time', target_to_caller)}"
await interaction.response.send_message(response)
@commands.command(name="headpat")
@ -788,8 +837,8 @@ class MessageCog(commands.Cog):
# Track usage between the two users
await self._increment_usage_counter(ctx.author.id, member.id, "neru_headpat")
# Get the updated count
count = await self._get_usage_count(ctx.author.id, member.id, "neru_headpat")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(ctx.author.id, member.id, "neru_headpat")
headpat_messages = [
f"{ctx.author.mention} gently pats {member.mention}'s head, a soft smile gracing their lips.",
@ -869,22 +918,22 @@ class MessageCog(commands.Cog):
f"{ctx.author.mention} gives {member.mention} a headpat, a loving touch that brings happiness.",
f"{ctx.author.mention} gives {member.mention} a headpat, a tender expression of solace.",
f"{ctx.author.mention} gives {member.mention} a headpat, a comforting gesture of joy.",
f"{ctx.author.mention} gives {member.mention} a headpat, a sweet and gentle touch that reassures.",
f"{ctx.author.mention} gives {member.mention} a headpat, a loving moment of understanding.",
f"{ctx.author.mention} gives {member.mention} a headpat, a tender touch that brings comfort.",
f"{ctx.author.mention} gives {member.mention} a headpat, a sweet gesture of peace.",
f"{ctx.author.mention} gives {member.mention} a headpat, a gentle caress that brings happiness.",
f"{ctx.author.mention} gives {member.mention} a headpat, a loving touch that brings solace.",
f"{ctx.author.mention} gives {member.mention} a headpat, a tender expression of joy.",
f"{ctx.author.mention} gives {member.mention} a headpat, a comforting gesture of peace.",
f"{ctx.author.mention} gives {member.mention} a headpat, a sweet and gentle moment of happiness.",
f"{ctx.author.mention} gives {member.mention} a headpat, a loving touch that brings comfort.",
f"{ctx.author.mention} gives {member.mention} a headpat, a tender caress that brings peace.",
f"{ctx.author.mention} gives {member.mention} a headpat, a sweet gesture of happiness.",
f"{ctx.author.mention} gives {member.mention} a headpat, a gentle touch that brings solace.",
f"{ctx.author.mention} gives {member.mention} a headpat, a loving caress that brings joy.",
f"{ctx.author.mention} gives {member.mention} a headpat, a tender expression of peace.",
f"{ctx.author.mention} gives {member.mention} a headpat, a comforting gesture of happiness.",
f"{ctx.author.mention} gives {member.mention} a sweet and gentle touch that reassures.",
f"{ctx.author.mention} gives {member.mention} a loving moment of understanding.",
f"{ctx.author.mention} gives {member.mention} a tender touch that brings comfort.",
f"{ctx.author.mention} gives {member.mention} a sweet gesture of peace.",
f"{ctx.author.mention} gives {member.mention} a gentle caress that brings happiness.",
f"{ctx.author.mention} gives {member.mention} a loving touch that brings solace.",
f"{ctx.author.mention} gives {member.mention} a tender expression of joy.",
f"{ctx.author.mention} gives {member.mention} a comforting gesture of peace.",
f"{ctx.author.mention} gives {member.mention} a sweet and gentle moment of happiness.",
f"{ctx.author.mention} gives {member.mention} a loving touch that brings comfort.",
f"{ctx.author.mention} gives {member.mention} a tender caress that brings peace.",
f"{ctx.author.mention} gives {member.mention} a sweet gesture of happiness.",
f"{ctx.author.mention} gives {member.mention} a gentle touch that brings solace.",
f"{ctx.author.mention} gives {member.mention} a loving caress that brings joy.",
f"{ctx.author.mention} gives {member.mention} a tender expression of peace.",
f"{ctx.author.mention} gives {member.mention} a comforting gesture of happiness.",
f"{ctx.author.mention} gives {member.mention} a sweet and gentle touch that brings comfort.",
f"{ctx.author.mention} gives {member.mention} a loving moment of peace.",
f"{ctx.author.mention} gives {member.mention} a tender touch that brings happiness.",
@ -1002,11 +1051,13 @@ class MessageCog(commands.Cog):
f"{ctx.author.mention} gives {member.mention} a headpat, a tender gesture of pure, unadulterated, and boundless love.",
f"{ctx.author.mention} gives {member.mention} a headpat, a sweet moment of absolute, serene, and perfect tranquility.",
]
# Get the updated count
count = await self._get_usage_count(ctx.author.id, member.id, "neru_headpat")
# Get the bidirectional counts
caller_to_target, target_to_caller = await self._get_bidirectional_usage_counts(ctx.author.id, member.id, "neru_headpat")
response = random.choice(headpat_messages)
response += f"\n-# {ctx.author.display_name} and {member.display_name} have headpatted {count} times"
response += f"\n-# {ctx.author.display_name} and {member.display_name} have headpatted {caller_to_target} {self.plural('time', caller_to_target)}"
if target_to_caller > 0:
response += f", {member.display_name} and {ctx.author.display_name} have headpatted {target_to_caller} {self.plural('time', target_to_caller)}"
await ctx.reply(response)
# --- Memes Group ---