-
Notifications
You must be signed in to change notification settings - Fork 42
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
Guild boost #161
Conversation
There was a problem hiding this 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]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
start_time: int, | |
start_time: int = 0, |
Impl api guild-boost/history