-
-
Notifications
You must be signed in to change notification settings - Fork 815
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implement reply sync #67 * bumped version from 0.2.2 to 0.2.3
- Loading branch information
Showing
6 changed files
with
76 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "tgcf" | ||
version = "0.2.2" | ||
version = "0.2.3" | ||
description = "The ultimate tool to automate custom telegram message forwarding." | ||
authors = ["aahnik <[email protected]>"] | ||
license = "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from typing import Dict | ||
|
||
from telethon.tl.custom.message import Message | ||
|
||
|
||
class EventUid: | ||
"""The objects of this class uniquely identifies a message with its chat id and message id.""" | ||
|
||
def __init__(self, event) -> None: | ||
self.chat_id = event.chat_id | ||
try: | ||
self.msg_id = event.id | ||
except: # pylint: disable=bare-except | ||
self.msg_id = event.deleted_id | ||
|
||
def __str__(self) -> str: | ||
return f"chat={self.chat_id} msg={self.msg_id}" | ||
|
||
def __eq__(self, other) -> bool: | ||
return self.chat_id == other.chat_id and self.msg_id == other.msg_id | ||
|
||
def __hash__(self) -> int: | ||
return hash(self.__str__()) | ||
|
||
|
||
class DummyEvent: | ||
def __init__(self, chat_id, msg_id): | ||
self.chat_id = chat_id | ||
self.id = msg_id | ||
|
||
|
||
stored: Dict[EventUid, Dict[int, Message]] = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters