fix(aurora): fixed a broken from_id method
All checks were successful
Actions / Build Documentation (MkDocs) (pull_request) Successful in 27s
Actions / Lint Code (Ruff & Pylint) (pull_request) Successful in 40s

This commit is contained in:
Seaswimmer 2024-05-24 04:09:27 -04:00
parent 0cc7d6079d
commit 7a9c9846de
Signed by: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -47,12 +47,12 @@ class PartialChannel(AuroraGuildModel):
if not channel: if not channel:
try: try:
channel = await bot.fetch_channel(channel_id) channel = await bot.fetch_channel(channel_id)
return cls(bot=bot, guild_id=channel.guild.id, id=channel.id, username=channel.name) return cls(bot=bot, guild_id=channel.guild.id, id=channel.id, name=channel.name)
except (NotFound, InvalidData, HTTPException, Forbidden) as e: except (NotFound, InvalidData, HTTPException, Forbidden) as e:
if e == Forbidden: if e == Forbidden:
return cls(bot=bot, guild_id=0, id=channel_id, name="Forbidden Channel") return cls(bot=bot, guild_id=0, id=channel_id, name="Forbidden Channel")
return cls(bot=bot, guild_id=0, id=channel_id, name="Deleted Channel") return cls(bot=bot, guild_id=0, id=channel_id, name="Deleted Channel")
return cls(bot=bot, guild_id=channel.guild.id, id=channel.id, username=channel.name) return cls(bot=bot, guild_id=channel.guild.id, id=channel.id, name=channel.name)
class PartialRole(AuroraGuildModel): class PartialRole(AuroraGuildModel):
id: int id: int