Update Telethon and use PyPI telethon-aio package

This commit is contained in:
Tulir Asokan
2018-03-04 13:35:24 +02:00
parent 172e472221
commit 021b60a45e
18 changed files with 37 additions and 38 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ import asyncio
import sqlalchemy as sql
from sqlalchemy import orm
from telethon.sessions import AlchemySessionContainer
from telethon_aio.sessions import AlchemySessionContainer
from mautrix_appservice import AppService
from .base import Base
@@ -66,7 +66,7 @@ if args.generate_registration:
sys.exit(0)
if config["appservice.debug"]:
telethon_log = logging.getLogger("telethon")
telethon_log = logging.getLogger("telethon_aio")
telethon_log.addHandler(handler)
telethon_log.setLevel(logging.DEBUG)
log.setLevel(logging.DEBUG)
+1 -1
View File
@@ -17,7 +17,7 @@
import platform
import os
from telethon.tl.types import *
from telethon_aio.tl.types import *
from mautrix_appservice import MatrixRequestError
from .tgclient import MautrixTelegramClient
+4 -4
View File
@@ -17,10 +17,10 @@
import logging
import re
from telethon.tl.types import *
from telethon.tl.functions.messages import GetChatsRequest
from telethon.tl.functions.channels import GetChannelsRequest
from telethon.errors import ChannelInvalidError, ChannelPrivateError
from telethon_aio.tl.types import *
from telethon_aio.tl.functions.messages import GetChatsRequest
from telethon_aio.tl.functions.channels import GetChannelsRequest
from telethon_aio.errors import ChannelInvalidError, ChannelPrivateError
from .abstract_user import AbstractUser
from .db import BotChat
+1 -1
View File
@@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import asyncio
from telethon.errors import *
from telethon_aio.errors import *
from . import command_handler
from .. import puppet as pu
+1 -1
View File
@@ -17,7 +17,7 @@
import markdown
import logging
from telethon.errors import FloodWaitError
from telethon_aio.errors import FloodWaitError
from ..util import format_duration
+1 -1
View File
@@ -14,7 +14,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/>.
from telethon.errors import *
from telethon_aio.errors import *
from mautrix_appservice import MatrixRequestError
from .. import portal as po
+4 -4
View File
@@ -14,10 +14,10 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from telethon.errors import *
from telethon.tl.types import User as TLUser
from telethon.tl.functions.messages import ImportChatInviteRequest, CheckChatInviteRequest
from telethon.tl.functions.channels import JoinChannelRequest
from telethon_aio.errors import *
from telethon_aio.tl.types import User as TLUser
from telethon_aio.tl.functions.messages import ImportChatInviteRequest, CheckChatInviteRequest
from telethon_aio.tl.functions.channels import JoinChannelRequest
from .. import puppet as pu, portal as po
from . import command_handler
+1 -1
View File
@@ -21,7 +21,7 @@ import math
import re
import logging
from telethon.tl.types import *
from telethon_aio.tl.types import *
from .. import user as u, puppet as pu, portal as po
from ..db import Message as DBMessage
+1 -1
View File
@@ -17,7 +17,7 @@
from html import escape
import logging
from telethon.tl.types import *
from telethon_aio.tl.types import *
from mautrix_appservice import MatrixRequestError
from .. import user as u, puppet as pu, portal as po
+4 -4
View File
@@ -25,10 +25,10 @@ import re
import magic
from telethon.tl.functions.messages import *
from telethon.tl.functions.channels import *
from telethon.errors.rpc_error_list import *
from telethon.tl.types import *
from telethon_aio.tl.functions.messages import *
from telethon_aio.tl.functions.channels import *
from telethon_aio.errors.rpc_error_list import *
from telethon_aio.tl.types import *
from mautrix_appservice import MatrixRequestError, IntentError
from .db import Portal as DBPortal, Message as DBMessage
+1 -1
View File
@@ -20,7 +20,7 @@ import asyncio
import pkg_resources
import logging
from telethon.errors import *
from telethon_aio.errors import *
from ..user import User
from ..commands.auth import enter_password
+2 -2
View File
@@ -18,8 +18,8 @@ from difflib import SequenceMatcher
import re
import logging
from telethon.tl.types import UserProfilePhoto
from telethon.errors.rpc_error_list import LocationInvalidError
from telethon_aio.tl.types import UserProfilePhoto
from telethon_aio.errors.rpc_error_list import LocationInvalidError
from .db import Puppet as DBPuppet
from . import util
+4 -4
View File
@@ -16,10 +16,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from io import BytesIO
from telethon import TelegramClient
from telethon.tl.functions.messages import SendMessageRequest, SendMediaRequest
from telethon.tl.types import *
from telethon.extensions.markdown import parse as parse_md
from telethon_aio import TelegramClient
from telethon_aio.tl.functions.messages import SendMessageRequest, SendMediaRequest
from telethon_aio.tl.types import *
from telethon_aio.extensions.markdown import parse as parse_md
class MautrixTelegramClient(TelegramClient):
+3 -3
View File
@@ -18,9 +18,9 @@ import logging
import asyncio
import re
from telethon.tl.types import *
from telethon.tl.types.contacts import ContactsNotModified
from telethon.tl.functions.contacts import GetContactsRequest, SearchRequest
from telethon_aio.tl.types import *
from telethon_aio.tl.types.contacts import ContactsNotModified
from telethon_aio.tl.functions.contacts import GetContactsRequest, SearchRequest
from mautrix_appservice import MatrixRequestError
from .db import User as DBUser, Contact as DBContact
+2 -2
View File
@@ -22,9 +22,9 @@ import magic
from PIL import Image
from sqlalchemy.exc import IntegrityError
from telethon.tl.types import (Document, FileLocation, InputFileLocation,
from telethon_aio.tl.types import (Document, FileLocation, InputFileLocation,
InputDocumentFileLocation)
from telethon.errors import LocationInvalidError
from telethon_aio.errors import LocationInvalidError
from ..db import TelegramFile as DBTelegramFile