moved settings

This commit is contained in:
2021-01-01 21:52:55 +00:00
parent 2da853946e
commit 7b0b2e344d
6 changed files with 42 additions and 41 deletions

View File

@@ -1,5 +1,5 @@
import yaml
from . import CHATFILE, TARGET, URL_HOSTNAME
from pytgbot.bot.sync import SyncBot
from pytgbot.api_types.sendable.inline import (
InlineQueryResultArticle,
@@ -23,7 +23,7 @@ import logging
logger = logging.getLogger()
from misc import SaveFileMapping, SaveFileObject
from lxml.html.clean import clean_html, Cleaner
import settings
solr = SolrFet2020()
@@ -181,10 +181,10 @@ class Chat(BaseChat):
InlineQueryResultArticle(
id=d["url"][0:49],
title=d["title"],
url=urljoin(TARGET, d["url"]),
thumb_url=urljoin(TARGET, d["image"]),
url=urljoin(settings.TARGET, d["url"]),
thumb_url=urljoin(settings.TARGET, d["image"]),
input_message_content=InputTextMessageContent(
message_text=urljoin(TARGET, d["url"])
message_text=urljoin(settings.TARGET, d["url"])
),
)
for d in r[0:10]
@@ -259,9 +259,9 @@ class Chat(BaseChat):
u.token = "afwerve"
u.a = 1
self.reply_msg(
urljoin("https://" + URL_HOSTNAME, "/auth/%s/%s" % (u.id, u.token))
urljoin("https://" + settings.URL_HOSTNAME, "/auth/%s/%s" % (u.id, u.token))
)
self.send_msg(urljoin("https://", URL_HOSTNAME))
self.send_msg(urljoin("https://", settings.URL_HOSTNAME))
users.to_file()
return True
else:
@@ -291,7 +291,7 @@ def get_command_from_update(update):
class ChatManager(SaveFileMapping):
def __init__(self, bot):
super().__init__(file=CHATFILE)
super().__init__(file=settings.CHATFILE)
if not type(bot) is SyncBot:
raise TelegramIntegrationException(
"This ChatManager needs a SyncBot from pytgbot as an argument"