Skip to content

Commit

Permalink
+ [ 4 files changed ] Fix getAuditLogs
Browse files Browse the repository at this point in the history
  • Loading branch information
null2264 committed Oct 25, 2021
1 parent 9a3f2b6 commit ca7607a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# v3.4

## 3.4.2
- [**Fixed**] Fixed `getAuditLogs`

## 3.4.1 (HotFix)
- [**Fixed**] Added missing file to git repo (`timer/_views.py`)
- [**Fixed**] Fixed "not in the list" error when it's not supposed to do that
Expand Down
2 changes: 1 addition & 1 deletion core/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ziBot(commands.Bot):

# --- NOTE: Information about the bot
author: str = getattr(config, "author", "ZiRO2264#9999")
version: str = "`3.4.1` - `overhaul`"
version: str = "`3.4.2` - `overhaul`"
links: Dict[str, str] = getattr(
config,
"links",
Expand Down
7 changes: 5 additions & 2 deletions exts/events/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import asyncio
import re
from contextlib import suppress
from typing import TYPE_CHECKING, Any, Dict, Optional
from typing import TYPE_CHECKING, Any, Dict, Optional, Union

import discord
import prettify_exceptions
Expand Down Expand Up @@ -171,8 +171,11 @@ async def onMemberJoin(self, member: discord.Member) -> None:
return

async def getAuditLogs(
self, guild: discord.Guild, limit=1, delay=2, **kwargs
self, target: Union[discord.Guild, discord.Member], limit=1, delay=2, **kwargs
) -> discord.AuditLogEntry:
guild: discord.Guild = (
target.guild if isinstance(target, discord.Member) else target
)
# discord needs a few second to update Audit Logs
await asyncio.sleep(delay)
return (await guild.audit_logs(limit=limit, **kwargs).flatten())[0]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "Z3R0"
version = "3.4.1"
version = "3.4.2"
description = "A multi-purpose open source discord bot"
authors = ["null2264"]
license = "MPL-2.0"
Expand Down

0 comments on commit ca7607a

Please sign in to comment.