Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guild boost #161

Merged
merged 4 commits into from
Nov 21, 2022
Merged

Guild boost #161

merged 4 commits into from
Nov 21, 2022

Conversation

DancingSnow0517
Copy link
Contributor

Copy link
Owner

@TWT233 TWT233 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修了一个unpack id,加了两个默认值

khl/guild.py Outdated
@@ -365,3 +382,16 @@ async def update_emoji(self, id: str, *, name: str = None):
async def delete_emoji(self, id: str):
"""delete a custom emoji"""
return await self.gate.exec_req(api.GuildEmoji.delete(id))

async def fetch_boost(self, start_time: int, end_time: int = int(time.time()), **kwargs) -> List[GuildBoost]:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
async def fetch_boost(self, start_time: int, end_time: int = int(time.time()), **kwargs) -> List[GuildBoost]:
async def fetch_boost(self, start_time: int = 0, end_time: int = int(time.time()), **kwargs) -> List[GuildBoost]:

khl/client.py Outdated
Comment on lines 313 to 317
guild_id = guild if isinstance(guild, str) else guild.id
boost_list = await self.gate.exec_paged_req(
api.GuildBoost.history(guild_id=guild_id, start_time=start_time, end_time=end_time),
**kwargs
)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
guild_id = guild if isinstance(guild, str) else guild.id
boost_list = await self.gate.exec_paged_req(
api.GuildBoost.history(guild_id=guild_id, start_time=start_time, end_time=end_time),
**kwargs
)
boost_list = await self.gate.exec_paged_req(
api.GuildBoost.history(guild_id=unpack_id(guild), start_time=start_time, end_time=end_time), **kwargs)

khl/client.py Outdated
@@ -297,5 +298,24 @@ async def update_channel(self,
channel_data = await channel.update(name, topic, slow_mode)
return public_channel_factory(_gate_=self.gate, **channel_data)

async def fetch_guild_boost(self,
guild: Union[str, Guild],
start_time: int,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
start_time: int,
start_time: int = 0,

@TWT233 TWT233 merged commit 4190b0a into TWT233:main Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants