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

Add royalnetprofile command

This commit is contained in:
Steffo 2019-07-06 19:01:56 +03:00
parent a5c011ea7e
commit d4119f0448
4 changed files with 24 additions and 4 deletions

View file

@ -1,5 +1,5 @@
from . import audio, bots, commands, database, network, utils, error, web
version = "5.0a26"
version = "5.0a27"
__all__ = ["audio", "bots", "commands", "database", "network", "utils", "error", "web"]

View file

@ -27,10 +27,11 @@ from .missing import MissingCommand
from .cv import CvCommand
from .pause import PauseCommand
from .queue import QueueCommand
from .royalnetprofile import RoyalnetprofileCommand
__all__ = ["NullCommand", "PingCommand", "ShipCommand", "SmecdsCommand", "CiaoruoziCommand", "ColorCommand",
"SyncCommand", "DiarioCommand", "RageCommand", "DateparserCommand", "AuthorCommand", "ReminderCommand",
"KvactiveCommand", "KvCommand", "KvrollCommand", "VideoinfoCommand", "SummonCommand", "PlayCommand",
"SkipCommand", "PlaymodeCommand", "VideochannelCommand", "MissingCommand", "CvCommand", "PauseCommand",
"QueueCommand"]
"QueueCommand", "RoyalnetprofileCommand"]

View file

@ -1,5 +1,5 @@
from ..utils import Command, Call
from ..database.tables import Royal, Telegram
from ..database.tables import Royal, Telegram, Discord
class AuthorCommand(Command):
@ -8,11 +8,12 @@ class AuthorCommand(Command):
command_description = "Ottieni informazioni sull'autore di questa chiamata."
command_syntax = ""
require_alchemy_tables = {Royal, Telegram}
require_alchemy_tables = {Royal, Telegram, Discord}
@classmethod
async def common(cls, call: Call):
author = await call.get_author()
if author is None:
await call.reply(f"☁️ L'autore di questa chiamata è sconosciuto.")
return
await call.reply(f"🌞 {str(author)} è l'autore di questa chiamata.")

View file

@ -0,0 +1,18 @@
import asyncio
from ..utils import Command, Call
from ..error import InvalidInputError
class RoyalnetprofileCommand(Command):
command_name = "royalnetprofile"
command_description = "Invia in chat il link al tuo profilo Royalnet!"
command_syntax = ""
@classmethod
async def common(cls, call: Call):
author = await call.get_author()
if author is None:
await call.reply("⚠️ Devi essere registrato a Royalnet per usare questo comando!")
return
await call.reply(f"🔗 https://ryg.steffo.eu/profile/{author.username}")