Lots of bug fixes related to mongoengine migration
This commit is contained in:
parent
2010a529ef
commit
c08eaa90f6
6 changed files with 11 additions and 6 deletions
|
@ -151,6 +151,8 @@ class BanCog(CacheCog):
|
||||||
"Mr. Stark is displeased with your presence. Please leave."
|
"Mr. Stark is displeased with your presence. Please leave."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
await ctx.defer()
|
||||||
|
|
||||||
mtype = type
|
mtype = type
|
||||||
if mtype == "perm":
|
if mtype == "perm":
|
||||||
mtype = "perma"
|
mtype = "perma"
|
||||||
|
@ -169,7 +171,7 @@ class BanCog(CacheCog):
|
||||||
fields.append(Field(name="Duration", value=f"{duration} hour(s)"))
|
fields.append(Field(name="Duration", value=f"{duration} hour(s)"))
|
||||||
|
|
||||||
user_embed = build_embed(
|
user_embed = build_embed(
|
||||||
title="You have been banned",
|
title=f"You have been banned from {ctx.guild.name}",
|
||||||
description=f"Reason: {reason}",
|
description=f"Reason: {reason}",
|
||||||
fields=fields,
|
fields=fields,
|
||||||
)
|
)
|
||||||
|
|
|
@ -57,7 +57,7 @@ class KickCog(CacheCog):
|
||||||
name=ctx.author.name + "#" + ctx.author.discriminator,
|
name=ctx.author.name + "#" + ctx.author.discriminator,
|
||||||
icon_url=ctx.author.avatar_url,
|
icon_url=ctx.author.avatar_url,
|
||||||
)
|
)
|
||||||
embed.set_thumbnail(ctx.guild.icon_url)
|
embed.set_thumbnail(url=ctx.guild.icon_url)
|
||||||
|
|
||||||
send_failed = False
|
send_failed = False
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -51,7 +51,9 @@ class MuteCog(commands.Cog):
|
||||||
if len(reason) > 100:
|
if len(reason) > 100:
|
||||||
await ctx.send("Reason must be < 100 characters", hidden=True)
|
await ctx.send("Reason must be < 100 characters", hidden=True)
|
||||||
return
|
return
|
||||||
mute_setting = Setting.get(guild=ctx.guild.id, setting="mute")
|
mute_setting = Setting.objects(
|
||||||
|
guild=ctx.guild.id, setting="mute"
|
||||||
|
).first()
|
||||||
if not mute_setting:
|
if not mute_setting:
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
"Please configure a mute role "
|
"Please configure a mute role "
|
||||||
|
|
|
@ -116,7 +116,7 @@ class WarningCog(CacheCog):
|
||||||
guild=ctx.guild.id,
|
guild=ctx.guild.id,
|
||||||
).order_by("-created_at")
|
).order_by("-created_at")
|
||||||
active_warns = Warning.objects(
|
active_warns = Warning.objects(
|
||||||
user=user.id, guild=ctx.guild.id, active=False
|
user=user.id, guild=ctx.guild.id, active=True
|
||||||
).order_by("-created_at")
|
).order_by("-created_at")
|
||||||
|
|
||||||
pages = []
|
pages = []
|
||||||
|
|
|
@ -39,9 +39,9 @@ class JokeCog(commands.Cog):
|
||||||
{"$match": {"score": {"$gt": threshold}}},
|
{"$match": {"score": {"$gt": threshold}}},
|
||||||
{"$sample": {"size": 1}},
|
{"$sample": {"size": 1}},
|
||||||
]
|
]
|
||||||
result = Joke.objects().aggregate(pipeline)
|
result = Joke.objects().aggregate(pipeline).first()
|
||||||
while result.body in ["[removed]", "[deleted]"]:
|
while result.body in ["[removed]", "[deleted]"]:
|
||||||
result = Joke.objects().aggregate(pipeline)
|
result = Joke.objects().aggregate(pipeline).first()
|
||||||
|
|
||||||
if result is None:
|
if result is None:
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
|
|
|
@ -126,6 +126,7 @@ class Reminder(Document):
|
||||||
active = BooleanField(default=True)
|
active = BooleanField(default=True)
|
||||||
user = SnowflakeField(required=True)
|
user = SnowflakeField(required=True)
|
||||||
guild = SnowflakeField(required=True)
|
guild = SnowflakeField(required=True)
|
||||||
|
channel = SnowflakeField(required=True)
|
||||||
message = StringField(max_length=100, required=True)
|
message = StringField(max_length=100, required=True)
|
||||||
remind_at = DateTimeField(required=True)
|
remind_at = DateTimeField(required=True)
|
||||||
created_at = DateTimeField(default=datetime.utcnow)
|
created_at = DateTimeField(default=datetime.utcnow)
|
||||||
|
|
Loading…
Add table
Reference in a new issue