mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
🐛 Fix dispenser key selection
This commit is contained in:
parent
6cfdd93af2
commit
f2029a484e
2 changed files with 9 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
[tool.poetry]
|
||||
name = "royalnet-telethon"
|
||||
version = "0.1.4"
|
||||
version = "0.1.5"
|
||||
description = "A Telethon-based frontend for the royalnet.engineer module."
|
||||
authors = ["Stefano Pigozzi <me@steffo.eu>"]
|
||||
license = "AGPL-3.0-or-later"
|
||||
|
|
|
@ -87,11 +87,17 @@ class TelethonPDA:
|
|||
if self.mode == TelethonPDAMode.GLOBAL:
|
||||
return None
|
||||
elif self.mode == TelethonPDAMode.USER:
|
||||
if event.from_id:
|
||||
return event.from_id.user_id
|
||||
else:
|
||||
return event.peer_id.user_id
|
||||
elif self.mode == TelethonPDAMode.CHAT:
|
||||
return event.chat_id
|
||||
elif self.mode == TelethonPDAMode.CHAT_USER:
|
||||
if event.from_id:
|
||||
return event.chat_id, event.from_id.user_id
|
||||
else:
|
||||
return event.chat_id, event.peer_id.user_id
|
||||
else:
|
||||
raise TypeError("Invalid mode")
|
||||
|
||||
|
|
Loading…
Reference in a new issue