diff --git a/ferris/channel.py b/ferris/channel.py index af258a1..1336291 100644 --- a/ferris/channel.py +++ b/ferris/channel.py @@ -78,7 +78,7 @@ async def send(self, content: str) -> Message: ) return Message(self._connection, m) - async def fetch_messages(self, limit: int = 100) -> List[Message]: + async def fetch_messages(self, limit: int = 100, offset: int = 0) -> List[Message]: """ |coro| @@ -90,6 +90,10 @@ async def fetch_messages(self, limit: int = 100) -> List[Message]: The maximum number of messages to fetch. Defaults to 100. Set it to None to fetch all messages. + + offset: int + The number of messages to skip. + Defaults to 0. Returns ------- @@ -97,7 +101,7 @@ async def fetch_messages(self, limit: int = 100) -> List[Message]: """ if limit is None: limit = 9223372036854775807 - data = await self._connection.api.channels(self.id).messages.get(params={'limit': limit}) + data = await self._connection.api.channels(self.id).messages.get(params={'limit': limit, 'offset': offset}) return [Message(self._connection, m) for m in data['messages']] async def edit(self, name: str) -> Channel: