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:
parent
a5c011ea7e
commit
d4119f0448
4 changed files with 24 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
from . import audio, bots, commands, database, network, utils, error, web
|
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"]
|
__all__ = ["audio", "bots", "commands", "database", "network", "utils", "error", "web"]
|
||||||
|
|
|
@ -27,10 +27,11 @@ from .missing import MissingCommand
|
||||||
from .cv import CvCommand
|
from .cv import CvCommand
|
||||||
from .pause import PauseCommand
|
from .pause import PauseCommand
|
||||||
from .queue import QueueCommand
|
from .queue import QueueCommand
|
||||||
|
from .royalnetprofile import RoyalnetprofileCommand
|
||||||
|
|
||||||
|
|
||||||
__all__ = ["NullCommand", "PingCommand", "ShipCommand", "SmecdsCommand", "CiaoruoziCommand", "ColorCommand",
|
__all__ = ["NullCommand", "PingCommand", "ShipCommand", "SmecdsCommand", "CiaoruoziCommand", "ColorCommand",
|
||||||
"SyncCommand", "DiarioCommand", "RageCommand", "DateparserCommand", "AuthorCommand", "ReminderCommand",
|
"SyncCommand", "DiarioCommand", "RageCommand", "DateparserCommand", "AuthorCommand", "ReminderCommand",
|
||||||
"KvactiveCommand", "KvCommand", "KvrollCommand", "VideoinfoCommand", "SummonCommand", "PlayCommand",
|
"KvactiveCommand", "KvCommand", "KvrollCommand", "VideoinfoCommand", "SummonCommand", "PlayCommand",
|
||||||
"SkipCommand", "PlaymodeCommand", "VideochannelCommand", "MissingCommand", "CvCommand", "PauseCommand",
|
"SkipCommand", "PlaymodeCommand", "VideochannelCommand", "MissingCommand", "CvCommand", "PauseCommand",
|
||||||
"QueueCommand"]
|
"QueueCommand", "RoyalnetprofileCommand"]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from ..utils import Command, Call
|
from ..utils import Command, Call
|
||||||
from ..database.tables import Royal, Telegram
|
from ..database.tables import Royal, Telegram, Discord
|
||||||
|
|
||||||
|
|
||||||
class AuthorCommand(Command):
|
class AuthorCommand(Command):
|
||||||
|
@ -8,11 +8,12 @@ class AuthorCommand(Command):
|
||||||
command_description = "Ottieni informazioni sull'autore di questa chiamata."
|
command_description = "Ottieni informazioni sull'autore di questa chiamata."
|
||||||
command_syntax = ""
|
command_syntax = ""
|
||||||
|
|
||||||
require_alchemy_tables = {Royal, Telegram}
|
require_alchemy_tables = {Royal, Telegram, Discord}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
async def common(cls, call: Call):
|
async def common(cls, call: Call):
|
||||||
author = await call.get_author()
|
author = await call.get_author()
|
||||||
if author is None:
|
if author is None:
|
||||||
await call.reply(f"☁️ L'autore di questa chiamata è sconosciuto.")
|
await call.reply(f"☁️ L'autore di questa chiamata è sconosciuto.")
|
||||||
|
return
|
||||||
await call.reply(f"🌞 {str(author)} è l'autore di questa chiamata.")
|
await call.reply(f"🌞 {str(author)} è l'autore di questa chiamata.")
|
||||||
|
|
18
royalnet/commands/royalnetprofile.py
Normal file
18
royalnet/commands/royalnetprofile.py
Normal 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}")
|
Loading…
Reference in a new issue