Fix discord list_by_channel API call
This commit is contained in:
parent
358b3cc24c
commit
45731bda80
2 changed files with 9 additions and 6 deletions
|
|
@ -120,6 +120,7 @@ class DiscordManager:
|
|||
raise RuntimeError(
|
||||
f'HTTP error calling API ({url}): {error}:\nHeaders:\n{error.headers}Body:\n{error.read()}') from error
|
||||
except urllib.error.URLError as error:
|
||||
self._logger.debug('Discord API HTTP error -> data: %s', data)
|
||||
raise RuntimeError(f'URL error calling API ({url}): {error}') from error
|
||||
except TimeoutError as error:
|
||||
raise RuntimeError(f'Timeout calling API ({url}): {error}') from error
|
||||
|
|
@ -207,6 +208,5 @@ class DiscordManager:
|
|||
if after_id is not None:
|
||||
params['after'] = after_id
|
||||
_, messages_info = self._send_request(
|
||||
*Api.Message.list_by_channel(channel.id), request_timeout=request_timeout,
|
||||
data=json.dumps(params, cls=ApiEncoder).encode() if params else None)
|
||||
*Api.Message.list_by_channel(channel.id, params=params), request_timeout=request_timeout)
|
||||
return [Message.from_dict(m) for m in messages_info or []]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue