mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
Add ciaoruozi command
This commit is contained in:
parent
015d459791
commit
c77ac7fbc3
2 changed files with 17 additions and 1 deletions
|
@ -81,7 +81,7 @@ class TelegramBot:
|
||||||
# Skip inexistent commands
|
# Skip inexistent commands
|
||||||
command = self.missing_command
|
command = self.missing_command
|
||||||
# Call the command
|
# Call the command
|
||||||
return await self.Call(message.chat, command, *parameters).run()
|
return await self.Call(message.chat, command, *parameters, update=update).run()
|
||||||
|
|
||||||
async def handle_net_request(self, message: Message):
|
async def handle_net_request(self, message: Message):
|
||||||
pass
|
pass
|
||||||
|
|
16
royalnet/commands/ciaoruozi.py
Normal file
16
royalnet/commands/ciaoruozi.py
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
from ..utils import Command, CommandArgs, Call
|
||||||
|
from telegram import Update, User
|
||||||
|
|
||||||
|
|
||||||
|
class CiaoruoziCommand(Command):
|
||||||
|
|
||||||
|
command_name = "ciaoruozi"
|
||||||
|
command_title = "Saluta Ruozi, anche se non è più in RYG."
|
||||||
|
|
||||||
|
async def telegram(self, call: Call, args: CommandArgs):
|
||||||
|
update: Update = args.kwargs["update"]
|
||||||
|
user: User = update.effective_user
|
||||||
|
if user.id == 112437036:
|
||||||
|
await call.reply("Ciao me!")
|
||||||
|
else:
|
||||||
|
await call.reply("Ciao Ruozi!")
|
Loading…
Reference in a new issue