used_component -> context
This commit is contained in:
parent
9c9bd36816
commit
68d29d9dd8
1 changed files with 5 additions and 6 deletions
|
@ -235,13 +235,12 @@ class RemindmeCog(CacheCog):
|
|||
)
|
||||
|
||||
try:
|
||||
used_component = await self.bot.wait_for_component(
|
||||
context = await self.bot.wait_for_component(
|
||||
check=lambda x: ctx.author.id == x.author_id,
|
||||
messages=message,
|
||||
components=components,
|
||||
timeout=60 * 5,
|
||||
)
|
||||
for to_delete in used_component.context.values:
|
||||
for to_delete in context.context.values:
|
||||
_ = Reminder.objects(user=ctx.author.id, id=ObjectId(to_delete)).delete()
|
||||
|
||||
for row in components:
|
||||
|
@ -249,7 +248,7 @@ class RemindmeCog(CacheCog):
|
|||
component["disabled"] = True
|
||||
|
||||
fields = []
|
||||
for reminder in filter(lambda x: str(x.id) in used_component.context.values, reminders):
|
||||
for reminder in filter(lambda x: str(x.id) in context.context.values, reminders):
|
||||
fields.append(
|
||||
EmbedField(
|
||||
name=reminder.remind_at.strftime("%Y-%m-%d %H:%M UTC"),
|
||||
|
@ -269,8 +268,8 @@ class RemindmeCog(CacheCog):
|
|||
)
|
||||
embed.set_thumbnail(url=ctx.author.display_avatar)
|
||||
|
||||
await used_component.context.edit_origin(
|
||||
content=f"Deleted {len(used_component.context.values)} reminder(s)",
|
||||
await context.context.edit_origin(
|
||||
content=f"Deleted {len(context.context.values)} reminder(s)",
|
||||
components=components,
|
||||
embed=embed,
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue