Bridge group chat portal metadata from Matrix to Telegram. Fixes #33
WARNING: Portal table schema changed. Run the following SQL before updating:
ALTER TABLE portal ADD COLUMN about VARCHAR
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
import re
|
||||
from telethon.tl.types import UserProfilePhoto
|
||||
from telethon.tl.types import UserProfilePhoto, PeerUser
|
||||
from telethon.errors.rpc_error_list import LocationInvalidError
|
||||
from .db import Puppet as DBPuppet
|
||||
|
||||
@@ -47,6 +47,9 @@ class Puppet:
|
||||
def tgid(self):
|
||||
return self.id
|
||||
|
||||
def get_input_entity(self, user):
|
||||
return user.client.get_input_entity(PeerUser(user_id=self.tgid))
|
||||
|
||||
def to_db(self):
|
||||
return self.db.merge(
|
||||
DBPuppet(id=self.id, username=self.username, displayname=self.displayname,
|
||||
|
||||
Reference in New Issue
Block a user