mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-10 08:34:52 +00:00
Compare commits
2 commits
ff05420048
...
ec6f737cfb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec6f737cfb | ||
|
|
cc42107fd7 |
2 changed files with 5 additions and 45 deletions
40
.github/workflows/python-publish.yml
vendored
40
.github/workflows/python-publish.yml
vendored
|
|
@ -1,40 +0,0 @@
|
||||||
# This workflow will upload a Python Package using Twine when a release is created
|
|
||||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
|
||||||
|
|
||||||
# This workflow uses actions that are not certified by GitHub.
|
|
||||||
# They are provided by a third-party and are governed by
|
|
||||||
# separate terms of service, privacy policy, and support
|
|
||||||
# documentation.
|
|
||||||
|
|
||||||
name: Upload Python Package
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment: release
|
|
||||||
permissions:
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.10'
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -e '.[dev]'
|
|
||||||
- name: Build package
|
|
||||||
run: hatch build
|
|
||||||
- name: Publish package
|
|
||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
|
||||||
|
|
@ -58,14 +58,14 @@ class MessageReactor(Object):
|
||||||
sender_chat: "types.Chat" = None
|
sender_chat: "types.Chat" = None
|
||||||
):
|
):
|
||||||
super().__init__(client)
|
super().__init__(client)
|
||||||
|
|
||||||
self.amount = amount
|
self.amount = amount
|
||||||
self.is_top = is_top
|
self.is_top = is_top
|
||||||
self.is_my = is_my
|
self.is_my = is_my
|
||||||
self.is_anonymous = is_anonymous
|
self.is_anonymous = is_anonymous
|
||||||
self.from_user = from_user
|
self.from_user = from_user
|
||||||
self.sender_chat = sender_chat
|
self.sender_chat = sender_chat
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _parse(
|
def _parse(
|
||||||
client: "pyrogram.Client",
|
client: "pyrogram.Client",
|
||||||
|
|
@ -75,17 +75,17 @@ class MessageReactor(Object):
|
||||||
) -> Optional["MessageReactor"]:
|
) -> Optional["MessageReactor"]:
|
||||||
if not message_reactor:
|
if not message_reactor:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
is_anonymous = message_reactor.anonymous
|
is_anonymous = message_reactor.anonymous
|
||||||
from_user = None
|
from_user = None
|
||||||
sender_chat = None
|
sender_chat = None
|
||||||
if not is_anonymous:
|
if not is_anonymous:
|
||||||
if isinstance(message_reactor.peer, raw.types.PeerUser):
|
if isinstance(message_reactor.peer_id, raw.types.PeerUser):
|
||||||
from_user = types.User._parse(
|
from_user = types.User._parse(
|
||||||
client,
|
client,
|
||||||
users.get(message_reactor.peer_id.user_id)
|
users.get(message_reactor.peer_id.user_id)
|
||||||
)
|
)
|
||||||
elif isinstance(message_reactor.peer, raw.types.PeerChannel):
|
elif isinstance(message_reactor.peer_id, raw.types.PeerChannel):
|
||||||
sender_chat = types.Chat._parse_channel_chat(
|
sender_chat = types.Chat._parse_channel_chat(
|
||||||
client,
|
client,
|
||||||
chats.get(message_reactor.peer_id.channel_id)
|
chats.get(message_reactor.peer_id.channel_id)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue