This commit is contained in:
parent
4960d40ac9
commit
5fa62fceca
1 changed files with 3 additions and 15 deletions
|
@ -420,13 +420,13 @@ class Moderation(commands.Cog):
|
||||||
try:
|
try:
|
||||||
member = await interaction.guild.fetch_member(case['target_id'])
|
member = await interaction.guild.fetch_member(case['target_id'])
|
||||||
await member.timeout(None, reason=f"Case #{case_number} resolved by {interaction.user.id}")
|
await member.timeout(None, reason=f"Case #{case_number} resolved by {interaction.user.id}")
|
||||||
except:
|
except discord.NotFound:
|
||||||
pass
|
pass
|
||||||
if case['moderation_type'] == 'tempban':
|
if case['moderation_type'] == 'tempban':
|
||||||
try:
|
try:
|
||||||
user = await interaction.client.fetch_user(case['target_id'])
|
user = await interaction.client.fetch_user(case['target_id'])
|
||||||
await interaction.guild.unban(user, reason=f"Case #{case_number} resolved by {interaction.user.id}")
|
await interaction.guild.unban(user, reason=f"Case #{case_number} resolved by {interaction.user.id}")
|
||||||
except:
|
except discord.NotFound:
|
||||||
pass
|
pass
|
||||||
resolve_query = f"UPDATE moderation_{interaction.guild.id} SET resolved = 1, expired = 1, resolve_reason = %s WHERE moderation_id = %s"
|
resolve_query = f"UPDATE moderation_{interaction.guild.id} SET resolved = 1, expired = 1, resolve_reason = %s WHERE moderation_id = %s"
|
||||||
else:
|
else:
|
||||||
|
@ -445,19 +445,7 @@ class Moderation(commands.Cog):
|
||||||
cursor.close()
|
cursor.close()
|
||||||
database.close()
|
database.close()
|
||||||
if result:
|
if result:
|
||||||
case = {
|
case = self.generate_dict(result)
|
||||||
"moderation_id": result[0],
|
|
||||||
"timestamp": result[1],
|
|
||||||
"moderation_type": result[2],
|
|
||||||
"target_id": result[3],
|
|
||||||
"moderator_id": result[4],
|
|
||||||
"duration": result[5],
|
|
||||||
"end_timestamp": result[6],
|
|
||||||
"reason": result[7],
|
|
||||||
"resolved": result[8],
|
|
||||||
"resolve_reason": result[9],
|
|
||||||
"expired": result[10]
|
|
||||||
}
|
|
||||||
try:
|
try:
|
||||||
target = await interaction.client.fetch_user(case["target_id"])
|
target = await interaction.client.fetch_user(case["target_id"])
|
||||||
target_user = {
|
target_user = {
|
||||||
|
|
Loading…
Reference in a new issue