Skip to content

Commit

Permalink
Restored original formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
progeroffline committed Jul 17, 2024
1 parent 345f49e commit c879aa7
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions twikit/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class Group:
members : list[:class:`str`]
Member IDs
"""

def __init__(self, client: Client, group_id: str, data: dict) -> None:
self._client = client
self.id = group_id
Expand All @@ -41,7 +40,9 @@ def __init__(self, client: Client, group_id: str, data: dict) -> None:
members = conversation_timeline["users"].values()
self.members: list[User] = [User(client, build_user_data(i)) for i in members]

async def get_history(self, max_id: str | None = None) -> Result[GroupMessage]:
async def get_history(
self, max_id: str | None = None
) -> Result[GroupMessage]:
"""
Retrieves the DM conversation history in the group.
Expand Down Expand Up @@ -112,7 +113,10 @@ async def change_name(self, name: str) -> Response:
return await self._client.change_group_name(self.id, name)

async def send_message(
self, text: str, media_id: str | None = None, reply_to: str | None = None
self,
text: str,
media_id: str | None = None,
reply_to: str | None = None
) -> GroupMessage:
"""
Sends a message to the group.
Expand Down Expand Up @@ -142,7 +146,9 @@ async def send_message(
>>> print(message)
<GroupMessage id='...'>
"""
return await self._client.send_dm_to_group(self.id, text, media_id, reply_to)
return await self._client.send_dm_to_group(
self.id, text, media_id, reply_to
)

async def update(self) -> None:
new = await self._client.get_group(self.id)
Expand All @@ -169,9 +175,12 @@ class GroupMessage(Message):
group_id : :class:`str`
The ID of the group.
"""

def __init__(
self, client: Client, data: dict, sender_id: str, group_id: str
self,
client: Client,
data: dict,
sender_id: str,
group_id: str
) -> None:
super().__init__(client, data, sender_id, None)
self.group_id = group_id
Expand All @@ -182,7 +191,9 @@ async def group(self) -> Group:
"""
return await self._client.get_group(self.group_id)

async def reply(self, text: str, media_id: str | None = None) -> GroupMessage:
async def reply(
self, text: str, media_id: str | None = None
) -> GroupMessage:
"""Replies to the message.
Parameters
Expand Down Expand Up @@ -222,7 +233,9 @@ async def add_reaction(self, emoji: str) -> Response:
:class:`httpx.Response`
Response returned from twitter api.
"""
return await self._client.add_reaction_to_message(self.id, self.group_id, emoji)
return await self._client.add_reaction_to_message(
self.id, self.group_id, emoji
)

async def remove_reaction(self, emoji: str) -> Response:
"""
Expand All @@ -243,4 +256,4 @@ async def remove_reaction(self, emoji: str) -> Response:
)

def __repr__(self) -> str:
return f'<GroupMessage id="{self.id}">'
return f'<GroupMessage id="{self.id}">'

0 comments on commit c879aa7

Please sign in to comment.