feat(shard): ✨ Add approve option to p.reports command.
This commit is contained in:
@@ -27,6 +27,11 @@ class ReportView(discord.ui.View):
|
||||
@discord.ui.select(
|
||||
placeholder="Select an action",
|
||||
options=[
|
||||
discord.SelectOption(
|
||||
value="approve",
|
||||
label="Approve",
|
||||
description="Send a nice message to the user (does not ban nor warn).",
|
||||
),
|
||||
discord.SelectOption(
|
||||
value="warn",
|
||||
label="Warn",
|
||||
@@ -82,7 +87,7 @@ class ReportView(discord.ui.View):
|
||||
fields=[
|
||||
discord.EmbedField(
|
||||
name="Message Content",
|
||||
value=f"You sent the following message in a call:\n> {formatting.trim(self.report.message_content, 900)}",
|
||||
value=f"{formatting.trim(self.report.message_content, 500)}",
|
||||
),
|
||||
discord.EmbedField(
|
||||
name="User Name",
|
||||
@@ -103,6 +108,35 @@ class ReportView(discord.ui.View):
|
||||
except discord.Forbidden:
|
||||
pass
|
||||
|
||||
elif select.values[0] == "approve":
|
||||
embed = discord.Embed(
|
||||
color=constants.APPROVE_COLOR,
|
||||
title="Approved",
|
||||
description="You got reported, but the mods laughed at this so the report got dismissed.",
|
||||
fields=[
|
||||
discord.EmbedField(
|
||||
name="Message Content",
|
||||
value=f"{formatting.trim(self.report.message_content, 500)}",
|
||||
),
|
||||
discord.EmbedField(
|
||||
name="User Name",
|
||||
value=self.report.user_name,
|
||||
),
|
||||
],
|
||||
thumbnail=self.report.user_avatar_url,
|
||||
footer=discord.EmbedFooter(
|
||||
text="🫢 Damn."
|
||||
),
|
||||
)
|
||||
|
||||
try:
|
||||
await (await self.bot.get_or_fetch_user(self.report.user_id)).send(
|
||||
embed=embed
|
||||
)
|
||||
|
||||
except discord.Forbidden:
|
||||
pass
|
||||
|
||||
else:
|
||||
user.bans_count += 1
|
||||
await user.save(force_update=True)
|
||||
|
||||
@@ -32,6 +32,7 @@ PRIMARY_COLOR = 0xE2D9D0
|
||||
SUPPORTER_COLOR = 0xAB9EFF
|
||||
MODERATOR_COLOR = 0xFF8787
|
||||
MASK_COLOR = 0xFFC868
|
||||
APPROVE_COLOR = 0x0FFF95
|
||||
|
||||
DISCORD_SERVER_INVITE = "https://discord.gg/fKuZty23pm"
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
version = 1
|
||||
revision = 1
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[[package]]
|
||||
@@ -128,7 +127,7 @@ version = "8.1.8"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "anyio" },
|
||||
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||
{ name = "colorama", marker = "platform_system == 'Windows'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/cb/b5/e1e5fdf1c1bb7e6e614987c120a98d9324bf8edfaa5f5cd16a6235c9d91b/asyncclick-8.1.8.tar.gz", hash = "sha256:0f0eb0f280e04919d67cf71b9fcdfb4db2d9ff7203669c40284485c149578e4c", size = 232900 }
|
||||
wheels = [
|
||||
@@ -198,7 +197,7 @@ name = "click"
|
||||
version = "8.1.8"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||
{ name = "colorama", marker = "platform_system == 'Windows'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b9/2e/0090cbf739cee7d23781ad4b89a9894a41538e4fcf4c31dcdd705b78eb8b/click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a", size = 226593 }
|
||||
wheels = [
|
||||
@@ -414,7 +413,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "payphone"
|
||||
version = "0.57.0"
|
||||
version = "0.58.0"
|
||||
source = { virtual = "." }
|
||||
dependencies = [
|
||||
{ name = "aerich" },
|
||||
|
||||
Reference in New Issue
Block a user