Skip to content

Commit

Permalink
use get_peer_id() instead of PeerChannel
Browse files Browse the repository at this point in the history
  • Loading branch information
adbenitez committed Oct 21, 2022
1 parent e2741d7 commit b707c39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions simplebot_tgchan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from telethon import TelegramClient
from telethon.tl.functions.channels import JoinChannelRequest
from telethon.tl.functions.messages import ImportChatInviteRequest
from telethon.tl.types import PeerChannel
from telethon.utils import get_peer_id

from .orm import Channel, Subscription, init, session_scope
from .subcommands import login
Expand Down Expand Up @@ -189,7 +189,7 @@ async def check_channels(bot: DeltaBot) -> None:


async def check_channel(bot: DeltaBot, client: TelegramClient, dbchan: Channel) -> None:
channel = await client.get_entity(PeerChannel(dbchan.id))
channel = await client.get_entity(get_peer_id(dbchan.id))
dbchan.title = channel.title
messages = list(
reversed(await client.get_messages(channel, min_id=dbchan.last_msg, limit=20))
Expand Down

0 comments on commit b707c39

Please sign in to comment.