Optimize config calls in few places (#3766)

* Just a tiny PR improving config call in a lot of places (Specially events and Help)

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* missed this one

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* welp

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* welp

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* welp

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* jack

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* Update redbot/cogs/mod/kickban.py

Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>

* jack

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
Draper
2020-04-20 18:29:36 +01:00
committed by GitHub
parent e4018ec677
commit f59e77002b
7 changed files with 153 additions and 116 deletions

View File

@@ -410,9 +410,8 @@ class KickBanMixin(MixinMeta):
queue_entry = (guild.id, user.id)
await self.config.member(user).banned_until.set(unban_time.timestamp())
cur_tbans = await self.config.guild(guild).current_tempbans()
cur_tbans.append(user.id)
await self.config.guild(guild).current_tempbans.set(cur_tbans)
async with self.config.guild(guild).current_tempbans() as current_tempbans:
current_tempbans.append(user.id)
with contextlib.suppress(discord.HTTPException):
# We don't want blocked DMs preventing us from banning