1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00
royalnet/royalpack/commands/skip.py

22 lines
700 B
Python
Raw Normal View History

2019-12-02 19:40:25 +00:00
from typing import *
2020-05-10 22:46:12 +00:00
import discord
import royalnet.commands as rc
2019-11-11 08:56:08 +00:00
2020-05-10 22:46:12 +00:00
class SkipCommand(rc.Command):
2019-11-11 08:56:08 +00:00
name: str = "skip"
2019-12-02 19:40:25 +00:00
aliases = ["s"]
2019-11-11 08:56:08 +00:00
2019-12-02 19:40:25 +00:00
description: str = "Salta il file attualmente in riproduzione."
2019-11-11 08:56:08 +00:00
2020-05-10 22:46:12 +00:00
async def run(self, args: rc.CommandArgs, data: rc.CommandData) -> None:
2019-12-02 19:40:25 +00:00
if self.interface.name == "discord":
message: discord.Message = data.message
guild: discord.Guild = message.guild
guild_id: Optional[int] = guild.id
else:
guild_id = None
response: Dict[str, Any] = await self.interface.call_herald_event("discord", "discord_skip", guild_id=guild_id)
await data.reply("⏩ File attuale saltato!")