Skip to content

Commit

Permalink
Merge pull request #18 from MegumiKatou02/feat
Browse files Browse the repository at this point in the history
Feat
  • Loading branch information
MegumiKatou02 authored Jan 10, 2025
2 parents f95104f + 36d53b0 commit 08d2f8c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
30 changes: 27 additions & 3 deletions cogs/query/send_GIF.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
import discord
from discord.ext import commands
from discord import app_commands

from enum import Enum
import config

GIPHY_API_KEY = config.GIPHY_API_KEY
GIPHY_URL = "https://api.giphy.com/v1/gifs/search"

class Action(Enum):
KISS = 'kiss',
HUG = 'hug'

class SendGIF(commands.Cog):
def __init__(self, bot):
self.bot = bot
Expand Down Expand Up @@ -62,11 +66,31 @@ async def fetch_gif(self, style: str, interaction: discord.Interaction, user: di

@app_commands.command(name="hug", description="Lệnh ôm ai đó và gửi GIF")
async def hug_command(self, interaction: discord.Interaction, user: discord.Member):
await self.fetch_gif("hug", interaction, user)
if user == interaction.user:
responses = [
f"Hugging yourself... 🤗 Somebody, come give you a hug!",
f"Giving yourself a big, warm hug! Don't be sad~ 💖",
f"Hugging yourself... Do you need a hug from someone special? <(\")",
f"Wrapping yourself up in a cozy blanket for a self-hug~ ☁️💞",
f"Snuggling a pillow tightly! Everything's gonna be okay~ 💕"
]
await interaction.response.send_message(random.choice(responses))
else:
await self.fetch_gif(Action.HUG.value, interaction, user)

@app_commands.command(name="kiss", description="Lệnh kiss ai đó và gửi GIF")
async def kiss(self, interaction: discord.Interaction, user: discord.Member):
await self.fetch_gif("kiss", interaction, user)
if user == interaction.user:
responses = [
f"Kisses themselves... 😘 Loving yourself is amazing!",
f"Gives themselves a cheek kiss~ UwU 💕",
f"Blows a kiss to themselves! 💋✨",
f"Smooches themselves! Someone should come and claim this kiss~ 💞",
f"Rewards themselves with a cute kiss! You're awesome! <(\")"
]
await interaction.response.send_message(random.choice(responses))
else:
await self.fetch_gif(Action.KISS.value, interaction, user)

async def setup(bot):
await bot.add_cog(SendGIF(bot))
4 changes: 3 additions & 1 deletion cogs/query/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ async def weather_command(self, interaction: discord.Interaction, city_name: str
embed = discord.Embed(
title=f"Thông tin thời tiết tại {city}, {country}",
description=f"{weather_description.capitalize()}",
color=discord.Color.blue()
color=discord.Color.red() if temperature >= 30 else discord.Color.orange() if temperature > 20 else discord.Color.blue()
)
embed.set_thumbnail(url=f"http://openweathermap.org/img/wn/{weather['icon']}@2x.png")
embed.add_field(name="Nhiệt độ", value=f"{temperature}°C", inline=False)
embed.add_field(name="Độ ẩm", value=f"{humidity}%", inline=False)
embed.add_field(name="Áp suất", value=f"{pressure} hPa", inline=False)
embed.add_field(name="Tốc độ gió", value=f"{wind_speed} m/s", inline=False)


await interaction.response.send_message(embed=embed)

async def setup(bot):
Expand Down
2 changes: 1 addition & 1 deletion cogs/stats/server_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async def server_stats(self, interaction: discord.Interaction):

embed = discord.Embed(
title=f"Thống Kê Server: {guild.name}",
color=0x67ff4f
color=0xFFFFFF
)
embed.add_field(name="Tổng số thành viên", value=total_members, inline=False)
embed.add_field(name="Số thành viên (người)", value=total_users, inline=True)
Expand Down
5 changes: 3 additions & 2 deletions cogs/user/recent_members.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ async def recent_members(self, interaction: discord.Interaction):

member_info = []
for member in recent_members:
join_date = member.joined_at.strftime('%d-%m-%Y %H:%M:%S')
member_info.append(f"**{member.name}** - Tham gia vào: {join_date}")
join_date = f"<t:{int(member.joined_at.timestamp())}>"
join_long = f"<t:{int(member.joined_at.timestamp())}:R>"
member_info.append(f"**{member.name}** - {join_date} ({join_long})")

embed = discord.Embed(
title="Các thành viên tham gia gần đây",
Expand Down

0 comments on commit 08d2f8c

Please sign in to comment.