예제 #1
0
    async def handle_matrix_title(self, sender: 'u.User', title: str) -> None:
        if self.peer_type not in ("chat", "channel"):
            return

        if self.peer_type == "chat":
            response = await sender.client(EditChatTitleRequest(chat_id=self.tgid, title=title))
        else:
            channel = await self.get_input_entity(sender)
            response = await sender.client(EditTitleRequest(channel=channel, title=title))
        self.dedup.register_outgoing_actions(response)
        self.title = title
        self.save()
예제 #2
0
    async def handle_matrix_title(self, sender: 'u.User', title: str,
                                  event_id: EventID) -> None:
        if self.peer_type not in ("chat", "channel"):
            return

        if self.peer_type == "chat":
            response = await sender.client(
                EditChatTitleRequest(chat_id=self.tgid, title=title))
        else:
            channel = await self.get_input_entity(sender)
            response = await sender.client(
                EditTitleRequest(channel=channel, title=title))
        self.dedup.register_outgoing_actions(response)
        self.title = title
        await self.save()
        await self._send_delivery_receipt(event_id)
        await self.update_bridge_info()
예제 #3
0
async def edit_title(title):
    global prog_tech_channel
    if prog_tech_channel is None:
        prog_tech_channel = await borg.get_entity(prog_tech_id)
    await borg(EditTitleRequest(channel=prog_tech_channel, title=title))
예제 #4
0
async def edit_title(event, title):
    chat = await event.get_input_chat()
    try:
        await event.client(EditTitleRequest(channel=chat, title=title))
    except ChatNotModifiedError:
        pass  # Everything is ok