Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions chiya/cogs/ban.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ async def ban(
return await embeds.send_error(ctx=ctx, description="Reason must be less than 1024 characters.")

mod_embed = discord.Embed()
mod_embed.title = f"Banning user: {user}"
mod_embed.description = f"{user.mention} was banned by {ctx.user.mention} for: {reason}"
mod_embed.title = f"Banned user: {user}"
mod_embed.description = f"{user.mention} was banned by {ctx.user.mention}"
mod_embed.color = 0xCD6D6D
mod_embed.add_field(name="Reason:", value=reason, inline=False)
mod_embed.set_author(icon_url=ctx.user.display_avatar, name=ctx.user.name)
mod_embed.set_thumbnail(url="https://files.catbox.moe/6hd0uw.png")

Expand Down Expand Up @@ -121,9 +122,10 @@ async def unban(self, ctx: discord.Interaction, user: discord.User | discord.Mem
return await embeds.send_error(ctx=ctx, description="Reason must be less than 1024 characters.")

embed = discord.Embed()
embed.title = f"Unbanning user: {user}"
embed.description = f"{user.mention} was unbanned by {ctx.user.mention} for: {reason}"
embed.title = f"Unbanned user: {user}"
embed.description = f"{user.mention} was unbanned by {ctx.user.mention}"
embed.color = discord.Color.green()
embed.add_field(name="Reason:", value=reason, inline=False)
embed.set_author(icon_url=ctx.user.display_avatar, name=ctx.user.name)
embed.set_thumbnail(url="https://files.catbox.moe/qhc82k.png")

Expand Down
2 changes: 1 addition & 1 deletion chiya/cogs/highlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async def on_message(self, message: discord.Message) -> None:
embed.title = term
embed.description = chat
embed.color = discord.Color.gold()
embed.add_field(name="Source Message", value=f"[Jump to]({message.jump_url})")
embed.add_field(name="Source Message:", value=f"[Jump to]({message.jump_url})")

for subscriber in users:
if subscriber == message.author.id or subscriber in active_members:
Expand Down
10 changes: 5 additions & 5 deletions chiya/cogs/kick.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async def kick(self, ctx: discord.Interaction, user: discord.User | discord.Memb
return await embeds.send_error(ctx=ctx, description="Reason must be less than 1024 characters.")

mod_embed = discord.Embed()
mod_embed.title = "Kicked member"
mod_embed.title = f"Kicked member: {user}"
mod_embed.description = f"{user.mention} was kicked by {ctx.user.mention}"
mod_embed.color = 0xCD6D6D
mod_embed.add_field(name="Reason:", value=reason, inline=False)
Expand Down Expand Up @@ -85,13 +85,13 @@ async def kick(self, ctx: discord.Interaction, user: discord.User | discord.Memb
await ctx.followup.send(embed=mod_embed)
await log_embed_to_channel(ctx=ctx, embed=mod_embed)

@app_commands.command(name="purgekick", description="Kick a member and delete their recent messages")
@app_commands.command(name="kickpurge", description="Kick a member and delete their recent messages")
@app_commands.guilds(config.guild_id)
@app_commands.describe(user="The member that will be kicked")
@app_commands.describe(reason="The reason why the member is being kicked")
@app_commands.describe(daystodelete="Days worth of messages to delete from the member, up to 7")
@app_commands.autocomplete(reason=reasons)
async def purgekick(
async def kickpurge(
self,
ctx: discord.Interaction,
user: discord.User | discord.Member,
Expand Down Expand Up @@ -125,7 +125,7 @@ async def purgekick(
deleted_messages = f"{daystodelete} day" if daystodelete == 1 else f"{daystodelete} days"

mod_embed = discord.Embed()
mod_embed.title = "Purge-kicked member"
mod_embed.title = f"Purge-kicked member: {user}"
mod_embed.description = f"{user.mention} was purge-kicked by {ctx.user.mention}"
mod_embed.color = 0xCD6D6D
mod_embed.add_field(name="Deleted messages:", value=deleted_messages, inline=False)
Expand All @@ -151,7 +151,7 @@ async def purgekick(
log.mod_id = ctx.user.id
log.timestamp = int(ctx.created_at.timestamp())
log.reason = reason
log.type = "purgekick"
log.type = "kickpurge"

db.session.add(log)
db.session.commit()
Expand Down
8 changes: 5 additions & 3 deletions chiya/cogs/mute.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ async def mute(
return await embeds.send_error(ctx=ctx, description="Timeout duration cannot exceed 7 days.")

mod_embed = discord.Embed()
mod_embed.title = "Muted member"
mod_embed.description = f"{user.mention} was muted by {ctx.user.mention} for: {reason}"
mod_embed.title = f"Muted member: {user}"
mod_embed.description = f"{user.mention} was muted by {ctx.user.mention}"
mod_embed.color = 0xCD6D6D
mod_embed.add_field(name="Expires:", value=f"<t:{int(muted_until.timestamp())}:R>", inline=True)
mod_embed.add_field(name="Reason:", value=reason, inline=False)
mod_embed.set_author(icon_url=ctx.user.display_avatar, name=ctx.user.name)
mod_embed.set_thumbnail(url="https://files.catbox.moe/6rs4fn.png")

user_embed = discord.Embed()
Expand Down Expand Up @@ -137,10 +138,11 @@ async def unmute(
return await embeds.send_error(ctx=ctx, description="Reason must be less than 1024 characters.")

mod_embed = discord.Embed()
mod_embed.title = "Unmuted member"
mod_embed.title = f"Unmuted member: {user}"
mod_embed.description = f"{user.mention} was unmuted by {ctx.user.mention}"
mod_embed.color = discord.Color.green()
mod_embed.add_field(name="Reason:", value=reason, inline=False)
mod_embed.set_author(icon_url=ctx.user.display_avatar, name=ctx.user.name)
mod_embed.set_thumbnail(url="https://files.catbox.moe/izm83m.png")

user_embed = discord.Embed()
Expand Down
7 changes: 5 additions & 2 deletions chiya/cogs/note.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ async def add_note(self, ctx: discord.Interaction, user: discord.User | discord.
db.session.commit()

embed = discord.Embed()
embed.title = f"Noting user: {user.name}"
embed.title = f"Noted user: {user}"
embed.description = f"{user.mention} was noted by {ctx.user.mention}"
embed.color = discord.Color.blurple()
embed.add_field(name="ID:", value=log.id, inline=False)
embed.add_field(name="Note:", value=log.reason, inline=False)
embed.set_author(icon_url=ctx.user.display_avatar, name=ctx.user.name)
embed.set_thumbnail(url="https://i.imgur.com/A4c19BJ.png")

await ctx.followup.send(embed=embed)
Expand Down Expand Up @@ -98,6 +99,7 @@ async def search_mod_actions(

embed = discord.Embed()
embed.title = "Mod Actions"
embed.color = discord.Color.blurple()
embed.set_author(name=user, icon_url=user.display_avatar)

formatter = MySource(actions, embed)
Expand Down Expand Up @@ -132,11 +134,12 @@ async def edit_log(self, ctx: discord.Interaction, id: int, note: str) -> None:
user = await self.bot.fetch_user(log.user_id)

embed = discord.Embed()
embed.title = f"Edited log: {user.name}"
embed.title = f"Edited log for: {user}"
embed.description = f"Log #{id} for {user.mention} was updated by {ctx.user.mention}"
embed.color = discord.Color.green()
embed.add_field(name="Before:", value=log.display_reason, inline=False)
embed.add_field(name="After:", value=note, inline=False)
embed.set_author(icon_url=ctx.user.display_avatar, name=ctx.user.name)
embed.set_thumbnail(url="https://i.imgur.com/A4c19BJ.png")

await ctx.followup.send(embed=embed)
Expand Down
3 changes: 2 additions & 1 deletion chiya/cogs/purge.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ async def purge(self, ctx: discord.Interaction, amount: int, reason: str) -> Non
embed = discord.Embed()
embed.title = "Purged messages"
embed.description = f"{ctx.user.mention} purged {amount} message(s) in {ctx.channel.mention}."
embed.color = discord.Color.red()
embed.color = 0xCD6D6D
embed.add_field(name="Reason:", value=reason, inline=False)
embed.set_author(icon_url=ctx.user.display_avatar, name=ctx.user.name)
embed.set_thumbnail(url="https://i.imgur.com/EDy6jCp.png")

await ctx.channel.purge(limit=amount, bulk=True, before=ctx.created_at)
Expand Down
2 changes: 1 addition & 1 deletion chiya/cogs/reminder.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ async def edit(self, ctx: discord.Interaction, reminder_id: int, new_message: st
db.session.commit()

embed = discord.Embed()
embed.title = "Reminder set"
embed.title = "Reminder updated"
embed.description = "Your reminder was updated"
embed.color = discord.Color.green()
embed.add_field(name="ID:", value=str(reminder_id), inline=False)
Expand Down
11 changes: 5 additions & 6 deletions chiya/cogs/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from chiya import db
from chiya.config import config
from chiya.models import Ticket
from chiya.utils import embeds


class TicketCog(commands.Cog):
Expand Down Expand Up @@ -130,12 +131,10 @@ async def create_ticket(self, ctx: discord.Interaction, button: discord.ui.Butto

ticket = discord.utils.get(ctx.guild.text_channels, name=f"ticket-{ctx.user.id}")
if ticket:
embed = discord.Embed()
embed.title = "Error:"
embed.description = f"{ctx.user.mention}, you already have a ticket open at: {ticket.mention}"
embed.color = discord.Color.red()
await ctx.response.send_message(embed=embed, ephemeral=True)
return
return await embeds.send_error(
ctx=ctx,
description=f"You already have a ticket open at: {ticket.mention}",
)

modal = TicketSubmissionModal(title="Ticket Submission")
await ctx.response.send_modal(modal)
Expand Down
4 changes: 2 additions & 2 deletions chiya/cogs/warn.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ async def warn(self, ctx: discord.Interaction, user: discord.User | discord.Memb
return await embeds.send_error(ctx=ctx, description="Reason must be less than 4096 characters.")

mod_embed = discord.Embed()
mod_embed.title = "Warned member"
mod_embed.title = f"Warned member: {user}"
mod_embed.description = f"{user.mention} was warned by {ctx.user.mention}"
mod_embed.color = discord.Color.gold()
mod_embed.add_field(name="Reason:", value=reason, inline=False)
mod_embed.set_author(icon_url=ctx.user.display_avatar, name=ctx.user.name)
mod_embed.set_thumbnail(url="https://files.catbox.moe/xbwoe8.png")

user_embed = discord.Embed()
user_embed.title = "Uh-oh, you've received a warning!"
user_embed.title = "Uh-oh, you've been warned!"
user_embed.description = "If you believe this was a mistake, contact staff."
user_embed.color = discord.Color.blurple()
user_embed.add_field(name="Server:", value=ctx.guild.name, inline=True)
Expand Down
Loading