mirror of
https://github.com/Xtao-Labs/iShotaBot.git
synced 2024-11-23 08:20:55 +00:00
fix: temp fix
This commit is contained in:
parent
c6d04539ae
commit
c20bce5105
5
init.py
5
init.py
@ -9,8 +9,6 @@ from logging import getLogger, INFO, ERROR, StreamHandler, basicConfig
|
|||||||
from coloredlogs import ColoredFormatter
|
from coloredlogs import ColoredFormatter
|
||||||
from cashews import cache
|
from cashews import cache
|
||||||
|
|
||||||
from models.temp_fix import temp_fix
|
|
||||||
|
|
||||||
# Config cache
|
# Config cache
|
||||||
cache.setup("mem://")
|
cache.setup("mem://")
|
||||||
# Enable logging
|
# Enable logging
|
||||||
@ -36,9 +34,6 @@ sqlite = Sqlite()
|
|||||||
bot = pyrogram.Client(
|
bot = pyrogram.Client(
|
||||||
"bot", api_id=api_id, api_hash=api_hash, ipv6=ipv6, plugins=dict(root="modules")
|
"bot", api_id=api_id, api_hash=api_hash, ipv6=ipv6, plugins=dict(root="modules")
|
||||||
)
|
)
|
||||||
# temp fix topics group
|
|
||||||
setattr(pyrogram.types.Message, "old_parse", getattr(pyrogram.types.Message, "_parse"))
|
|
||||||
setattr(pyrogram.types.Message, "_parse", temp_fix)
|
|
||||||
headers = {
|
headers = {
|
||||||
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.72 Safari/537.36"
|
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.72 Safari/537.36"
|
||||||
}
|
}
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
import pyrogram
|
|
||||||
|
|
||||||
|
|
||||||
async def temp_fix(
|
|
||||||
client: "pyrogram.Client",
|
|
||||||
message: pyrogram.raw.base.Message,
|
|
||||||
users: dict,
|
|
||||||
chats: dict,
|
|
||||||
topics: dict = None,
|
|
||||||
is_scheduled: bool = False,
|
|
||||||
replies: int = 1,
|
|
||||||
business_connection_id: str = None,
|
|
||||||
reply_to_message: "raw.base.Message" = None,
|
|
||||||
):
|
|
||||||
parsed = await pyrogram.types.Message.old_parse(
|
|
||||||
client,
|
|
||||||
message,
|
|
||||||
users,
|
|
||||||
chats,
|
|
||||||
topics,
|
|
||||||
is_scheduled,
|
|
||||||
replies,
|
|
||||||
business_connection_id,
|
|
||||||
reply_to_message,
|
|
||||||
) # noqa
|
|
||||||
if (
|
|
||||||
isinstance(message, pyrogram.raw.types.Message)
|
|
||||||
and message.reply_to
|
|
||||||
and hasattr(message.reply_to, "forum_topic")
|
|
||||||
and message.reply_to.forum_topic
|
|
||||||
and not message.reply_to.reply_to_top_id
|
|
||||||
):
|
|
||||||
parsed.reply_to_top_message_id = parsed.reply_to_message_id
|
|
||||||
parsed.reply_to_message_id = None
|
|
||||||
parsed.reply_to_message = None
|
|
||||||
return parsed
|
|
@ -1,4 +1,4 @@
|
|||||||
pyrogram==2.0.106
|
git+https://github.com/TeamPGM/pyrogram
|
||||||
tgcrypto==1.2.5
|
tgcrypto==1.2.5
|
||||||
bilibili-api-python==16.2.1
|
bilibili-api-python==16.2.1
|
||||||
httpx
|
httpx
|
||||||
|
Loading…
Reference in New Issue
Block a user