parent
a940ba7aba
commit
c963dbd889
2 changed files with 60 additions and 19 deletions
|
@ -14,15 +14,8 @@ from psutil import Process
|
|||
from jarvis import logo, utils
|
||||
from jarvis.config import get_config
|
||||
from jarvis.db import DBManager
|
||||
from jarvis.db.types import (
|
||||
Autopurge,
|
||||
Autoreact,
|
||||
Ban,
|
||||
Lock,
|
||||
Mute,
|
||||
Setting,
|
||||
Warning,
|
||||
)
|
||||
from jarvis.db.types import (Autopurge, Autoreact, Ban, Lock, Mute, Setting,
|
||||
Warning)
|
||||
from jarvis.utils import build_embed
|
||||
from jarvis.utils.field import Field
|
||||
|
||||
|
@ -44,7 +37,7 @@ jarvis = commands.Bot(
|
|||
)
|
||||
slash = SlashCommand(jarvis, sync_commands=True, sync_on_cog_reload=True)
|
||||
jarvis_self = Process()
|
||||
__version__ = "1.5.7"
|
||||
__version__ = "1.5.8"
|
||||
|
||||
|
||||
db = DBManager(get_config().mongo).mongo
|
||||
|
|
|
@ -175,10 +175,13 @@ class AdminCog(commands.Cog):
|
|||
)
|
||||
|
||||
admin_embed.set_author(
|
||||
name=user.name + "#" + user.discriminator, icon_url=user.avatar_url
|
||||
name=user.nick if user.nick else user.name,
|
||||
icon_url=user.avatar_url,
|
||||
)
|
||||
admin_embed.set_thumbnail(url=user.avatar_url)
|
||||
admin_embed.set_footer(text=f"User ID: {user.id}")
|
||||
admin_embed.set_footer(
|
||||
text=f"{user.name}#{user.discriminator} | {user.id}"
|
||||
)
|
||||
|
||||
await ctx.send(embed=admin_embed)
|
||||
if type != "temp":
|
||||
|
@ -211,7 +214,19 @@ class AdminCog(commands.Cog):
|
|||
admin=ctx.author.id,
|
||||
reason=reason,
|
||||
).insert()
|
||||
await ctx.send("User successfully unbanned.\nReason: " + reason)
|
||||
|
||||
embed = build_embed(
|
||||
title="User Unbanned",
|
||||
description=f"<@{user.id}> was unbanned",
|
||||
fields=[Field(name="Reason", value=reason)],
|
||||
)
|
||||
embed.set_author(
|
||||
name=user.name,
|
||||
icon_url=user.avatar_url,
|
||||
)
|
||||
embed.set_thumbnail(url=user.avatar_url)
|
||||
embed.set_footer(text=f"{user.name}#{user.discriminator} | {user.id}")
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
@cog_ext.cog_slash(
|
||||
name="unban",
|
||||
|
@ -518,18 +533,19 @@ class AdminCog(commands.Cog):
|
|||
send_failed = True
|
||||
await ctx.guild.kick(user, reason=reason)
|
||||
|
||||
fields = [Field(name="DM Sent?", value=str(not send_failed))]
|
||||
embed = build_embed(
|
||||
title="User Kicked",
|
||||
description=f"Reason: {reason}",
|
||||
fields=[],
|
||||
fields=fields,
|
||||
)
|
||||
|
||||
embed.set_author(
|
||||
name=user.name + "#" + user.discriminator,
|
||||
name=user.nick if user.nick else user.name,
|
||||
icon_url=user.avatar_url,
|
||||
)
|
||||
embed.set_thumbnail(url=user.avatar_url)
|
||||
embed.set_footer(text=f"User ID: {user.id}")
|
||||
embed.set_footer(text=f"{user.name}#{user.discriminator} | {user.id}")
|
||||
|
||||
await ctx.send(embed=embed)
|
||||
_ = Kick(
|
||||
|
@ -629,7 +645,19 @@ class AdminCog(commands.Cog):
|
|||
duration=duration,
|
||||
active=True if duration >= 0 else False,
|
||||
).insert()
|
||||
await ctx.send(f"{user.mention} has been muted.\nReason: {reason}")
|
||||
|
||||
embed = build_embed(
|
||||
title="User Muted",
|
||||
description=f"{user.mention} has been muted",
|
||||
fields=[Field(name="Reason", value=reason)],
|
||||
)
|
||||
embed.set_author(
|
||||
name=user.nick if user.nick else user.name,
|
||||
icon_url=user.avatar_url,
|
||||
)
|
||||
embed.set_thumbnail(url=user.avatar_url)
|
||||
embed.set_footer(text=f"{user.name}#{user.discriminator} | {user.id}")
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
@cog_ext.cog_slash(
|
||||
name="unmute",
|
||||
|
@ -665,7 +693,18 @@ class AdminCog(commands.Cog):
|
|||
for mute in mutes:
|
||||
mute.active = False
|
||||
mute.update()
|
||||
await ctx.send(f"{user.mention} has been unmuted.")
|
||||
embed = build_embed(
|
||||
title="User Unmwaruted",
|
||||
description=f"{user.mention} has been unmuted",
|
||||
fields=[],
|
||||
)
|
||||
embed.set_author(
|
||||
name=user.nick if user.nick else user.name,
|
||||
icon_url=user.avatar_url,
|
||||
)
|
||||
embed.set_thumbnail(url=user.avatar_url)
|
||||
embed.set_footer(text=f"{user.name}#{user.discriminator} | {user.id}")
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
async def _lock_channel(
|
||||
self,
|
||||
|
@ -998,12 +1037,18 @@ class AdminCog(commands.Cog):
|
|||
else:
|
||||
fields = []
|
||||
for warn in active_warns:
|
||||
admin = ctx.guild.get(warn.admin)
|
||||
admin_name = "||`[redacted]`||"
|
||||
if admin:
|
||||
admin_name = f"{admin.name}#{admin.discriminator}"
|
||||
fields.append(
|
||||
Field(
|
||||
name=warn.created_at.strftime(
|
||||
"%Y-%m-%d %H:%M:%S UTC"
|
||||
),
|
||||
value=warn.reason + "\n\u200b",
|
||||
value=f"{warn.reason}\n"
|
||||
+ f"Admin: {admin_name}\n"
|
||||
+ "\u200b",
|
||||
inline=False,
|
||||
)
|
||||
)
|
||||
|
@ -1019,6 +1064,9 @@ class AdminCog(commands.Cog):
|
|||
icon_url=user.avatar_url,
|
||||
)
|
||||
embed.set_thumbnail(url=ctx.guild.icon_url)
|
||||
embed.set_footer(
|
||||
text=f"{user.name}#{user.discriminator} | {user.id}"
|
||||
)
|
||||
pages.append(embed)
|
||||
else:
|
||||
fields = []
|
||||
|
|
Loading…
Add table
Reference in a new issue