1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Fix update -> message bugs

This commit is contained in:
Steffo 2020-01-20 19:04:59 +01:00
parent 81a8f791fa
commit 6623853a8d
3 changed files with 6 additions and 8 deletions

View file

@ -9,8 +9,7 @@ class CiaoruoziCommand(Command):
async def run(self, args: CommandArgs, data: CommandData) -> None: async def run(self, args: CommandArgs, data: CommandData) -> None:
if self.interface.name == "telegram": if self.interface.name == "telegram":
update: telegram.Update = data.update user: telegram.User = data.message.from_user
user: telegram.User = update.effective_user
# Se sei Ruozi, salutati da solo! # Se sei Ruozi, salutati da solo!
if user.id == 112437036: if user.id == 112437036:
await data.reply("👋 Ciao me!") await data.reply("👋 Ciao me!")

View file

@ -38,8 +38,7 @@ class DiarioCommand(Command):
async def run(self, args: CommandArgs, data: CommandData) -> None: async def run(self, args: CommandArgs, data: CommandData) -> None:
if self.interface.name == "telegram": if self.interface.name == "telegram":
update: telegram.Update = data.update message: telegram.Message = data.message
message: telegram.Message = update.message
reply: telegram.Message = message.reply_to_message reply: telegram.Message = message.reply_to_message
creator = await data.get_author() creator = await data.get_author()
# noinspection PyUnusedLocal # noinspection PyUnusedLocal

View file

@ -11,10 +11,10 @@ class RageCommand(Command):
description: str = "Arrabbiati per qualcosa, come una software house californiana." description: str = "Arrabbiati per qualcosa, come una software house californiana."
_MAD = ["MADDEN MADDEN MADDEN MADDEN", _MAD = ["MADDEN MADDEN MADDEN MADDEN",
"EA bad, praise Geraldo!", "EA bad, praise Geraldo!",
"Stai sfogando la tua ira sul bot!", "Stai sfogando la tua ira sul bot!",
"Basta, io cambio gilda!", "Basta, io cambio gilda!",
"Fondiamo la RRYG!"] "Fondiamo la RRYG!"]
async def run(self, args: CommandArgs, data: CommandData) -> None: async def run(self, args: CommandArgs, data: CommandData) -> None:
await data.reply(f"😠 {random.sample(self._MAD, 1)[0]}") await data.reply(f"😠 {random.sample(self._MAD, 1)[0]}")