mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 12:51:18 +00:00
Use the refactored types in get_chat_member(s)
This commit is contained in:
parent
66cd896a99
commit
31b046e5cc
@ -17,7 +17,8 @@
|
||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pyrogram.api import functions, types, errors
|
||||
from ...ext import BaseClient, utils
|
||||
from ...ext import BaseClient
|
||||
import pyrogram
|
||||
|
||||
|
||||
class GetChatMember(BaseClient):
|
||||
@ -51,7 +52,7 @@ class GetChatMember(BaseClient):
|
||||
)
|
||||
)
|
||||
|
||||
for member in utils.parse_chat_members(full_chat).chat_members:
|
||||
for member in pyrogram.ChatMembers.parse(self, full_chat).chat_members:
|
||||
if member.user.id == user_id.user_id:
|
||||
return member
|
||||
else:
|
||||
@ -64,7 +65,8 @@ class GetChatMember(BaseClient):
|
||||
)
|
||||
)
|
||||
|
||||
return utils.parse_chat_members(
|
||||
return pyrogram.ChatMembers.parse(
|
||||
self,
|
||||
types.channels.ChannelParticipants(
|
||||
count=1,
|
||||
participants=[r.participant],
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
from pyrogram.api import functions, types
|
||||
from ...ext import BaseClient, utils
|
||||
import pyrogram
|
||||
|
||||
|
||||
class Filters:
|
||||
@ -83,7 +84,8 @@ class GetChatMembers(BaseClient):
|
||||
peer = self.resolve_peer(chat_id)
|
||||
|
||||
if isinstance(peer, types.InputPeerChat):
|
||||
return utils.parse_chat_members(
|
||||
return pyrogram.ChatMembers.parse(
|
||||
self,
|
||||
self.send(
|
||||
functions.messages.GetFullChat(
|
||||
peer.chat_id
|
||||
@ -108,7 +110,8 @@ class GetChatMembers(BaseClient):
|
||||
else:
|
||||
raise ValueError("Invalid filter \"{}\"".format(filter))
|
||||
|
||||
return utils.parse_chat_members(
|
||||
return pyrogram.ChatMembers.parse(
|
||||
self,
|
||||
self.send(
|
||||
functions.channels.GetParticipants(
|
||||
channel=peer,
|
||||
|
Loading…
Reference in New Issue
Block a user