2016-11-11 16:03:31 +13:00
|
|
|
from .utils import checks
|
|
|
|
|
|
|
|
import discord
|
|
|
|
from discord.ext import commands
|
|
|
|
|
2016-11-29 21:05:22 +13:00
|
|
|
|
2016-11-11 16:03:31 +13:00
|
|
|
class Music:
|
2016-11-11 16:12:30 +13:00
|
|
|
"""
|
|
|
|
This cog is simply created in order to add all commands in the playlist cog
|
|
|
|
in case 'this' instance of the bot has not loaded the playlist cog.
|
|
|
|
This is useful to have the possiblity to split the music and text commands,
|
|
|
|
And still use commands that require another command to be passed
|
|
|
|
from the instance that hasn't loaded the playlist cog
|
|
|
|
"""
|
2016-11-29 21:05:22 +13:00
|
|
|
|
2016-11-11 16:03:31 +13:00
|
|
|
def __init__(self, bot):
|
|
|
|
self.bot = bot
|
|
|
|
|
|
|
|
async def on_voice_state_update(self, before, after):
|
|
|
|
pass
|
|
|
|
|
|
|
|
@commands.command(pass_context=True, no_pm=True, enabled=False)
|
|
|
|
@checks.custom_perms(send_messages=True)
|
|
|
|
async def progress(self, ctx):
|
2016-11-29 17:55:55 +13:00
|
|
|
"""Provides the progress of the current song
|
|
|
|
|
|
|
|
EXAMPLE: !progress
|
|
|
|
RESULT: 532 minutes! (Hopefully not)"""
|
2016-11-11 16:03:31 +13:00
|
|
|
pass
|
|
|
|
|
|
|
|
@commands.command(pass_context=True, no_pm=True, enabled=False)
|
|
|
|
@checks.custom_perms(send_messages=True)
|
|
|
|
async def join(self, ctx, *, channel: discord.Channel):
|
2016-11-29 17:55:55 +13:00
|
|
|
"""Joins a voice channel.
|
|
|
|
|
|
|
|
EXAMPLE: !join Music
|
|
|
|
RESULT: I'm in the Music voice channel!"""
|
2016-11-11 16:03:31 +13:00
|
|
|
pass
|
|
|
|
|
|
|
|
@commands.command(pass_context=True, no_pm=True, enabled=False)
|
|
|
|
@checks.custom_perms(send_messages=True)
|
|
|
|
async def summon(self, ctx):
|
2016-11-29 17:55:55 +13:00
|
|
|
"""Summons the bot to join your voice channel.
|
|
|
|
|
|
|
|
EXAMPLE: !summon
|
|
|
|
RESULT: I'm in your voice channel!"""
|
2016-11-11 16:03:31 +13:00
|
|
|
pass
|
|
|
|
|
|
|
|
@commands.command(pass_context=True, no_pm=True, enabled=False)
|
|
|
|
@checks.custom_perms(send_messages=True)
|
|
|
|
async def play(self, ctx, *, song: str):
|
2016-11-29 17:55:55 +13:00
|
|
|
"""Plays a song.
|
|
|
|
If there is a song currently in the queue, then it is
|
|
|
|
queued until the next song is done playing.
|
|
|
|
This command automatically searches as well from YouTube.
|
|
|
|
The list of supported sites can be found here:
|
|
|
|
https://rg3.github.io/youtube-dl/supportedsites.html
|
2017-02-07 16:10:06 +13:00
|
|
|
|
2016-11-29 17:55:55 +13:00
|
|
|
EXAMPLE: !play Song by Band
|
|
|
|
RESULT: Song by Band will be queued to play!
|
|
|
|
"""
|
2016-11-11 16:03:31 +13:00
|
|
|
pass
|
|
|
|
|
|
|
|
@commands.command(pass_context=True, no_pm=True, enabled=False)
|
|
|
|
@checks.custom_perms(kick_members=True)
|
|
|
|
async def volume(self, ctx, value: int = None):
|
2016-11-29 17:55:55 +13:00
|
|
|
"""Sets the volume of the currently playing song.
|
|
|
|
|
|
|
|
EXAMPLE: !volume 50
|
|
|
|
RESULT: My volume is now set to 50"""
|
2016-11-11 16:03:31 +13:00
|
|
|
pass
|
|
|
|
|
|
|
|
@commands.command(pass_context=True, no_pm=True, enabled=False)
|
|
|
|
@checks.custom_perms(kick_members=True)
|
|
|
|
async def pause(self, ctx):
|
2016-11-29 17:55:55 +13:00
|
|
|
"""Pauses the currently played song.
|
|
|
|
|
|
|
|
EXAMPLE: !pause
|
|
|
|
RESULT: I'm paused!"""
|
2016-11-11 16:03:31 +13:00
|
|
|
pass
|
|
|
|
|
|
|
|
@commands.command(pass_context=True, no_pm=True, enabled=False)
|
|
|
|
@checks.custom_perms(kick_members=True)
|
|
|
|
async def resume(self, ctx):
|
2016-11-29 17:55:55 +13:00
|
|
|
"""Resumes the currently played song.
|
|
|
|
|
|
|
|
EXAMPLE: !resume
|
|
|
|
RESULT: Ain't paused no more!"""
|
2016-11-11 16:03:31 +13:00
|
|
|
pass
|
|
|
|
|
|
|
|
@commands.command(pass_context=True, no_pm=True, enabled=False)
|
|
|
|
@checks.custom_perms(kick_members=True)
|
|
|
|
async def stop(self, ctx):
|
2016-11-29 17:55:55 +13:00
|
|
|
"""Stops playing audio and leaves the voice channel.
|
|
|
|
This also clears the queue.
|
|
|
|
|
|
|
|
EXAMPLE: !stop
|
|
|
|
RESULT: No more music"""
|
2016-11-11 16:03:31 +13:00
|
|
|
pass
|
|
|
|
|
|
|
|
@commands.command(pass_context=True, no_pm=True, enabled=False)
|
|
|
|
@checks.custom_perms(send_messages=True)
|
|
|
|
async def eta(self, ctx):
|
2016-11-29 17:55:55 +13:00
|
|
|
"""Provides an ETA on when your next song will play
|
|
|
|
|
|
|
|
EXAMPLE: !eta
|
|
|
|
RESULT: 5,000 days! Lol have fun"""
|
2016-11-11 16:03:31 +13:00
|
|
|
pass
|
|
|
|
|
|
|
|
@commands.command(pass_context=True, no_pm=True, enabled=False)
|
|
|
|
@checks.custom_perms(send_messages=True)
|
|
|
|
async def queue(self, ctx):
|
2017-02-07 16:10:06 +13:00
|
|
|
"""Provides a printout of the songs that are in the queue.
|
|
|
|
\N{LEFTWARDS BLACK ARROW}: Goes to the previous page
|
|
|
|
\N{BLACK RIGHTWARDS ARROW}: Goes to the next page
|
|
|
|
\N{DOWNWARDS BLACK ARROW}: Moves the current song showing back in the queue
|
|
|
|
\N{UPWARDS BLACK ARROW}: Moves the current song showing up in the queue
|
|
|
|
\N{CROSS MARK}: Removes the current song showing from the queue
|
2016-11-29 17:55:55 +13:00
|
|
|
|
|
|
|
EXAMPLE: !queue
|
|
|
|
RESULT: A list of shitty songs you probably don't wanna listen to"""
|
2016-11-11 16:03:31 +13:00
|
|
|
pass
|
|
|
|
|
|
|
|
@commands.command(pass_context=True, no_pm=True, enabled=False)
|
|
|
|
@checks.custom_perms(send_messages=True)
|
|
|
|
async def queuelength(self, ctx):
|
2016-11-29 17:55:55 +13:00
|
|
|
"""Prints the length of the queue
|
|
|
|
|
|
|
|
EXAMPLE: !queuelength
|
|
|
|
RESULT: Probably 10 songs"""
|
2016-11-11 16:03:31 +13:00
|
|
|
pass
|
|
|
|
|
|
|
|
@commands.command(pass_context=True, no_pm=True, enabled=False)
|
|
|
|
@checks.custom_perms(send_messages=True)
|
|
|
|
async def skip(self, ctx):
|
2016-11-29 17:55:55 +13:00
|
|
|
"""Vote to skip a song. The song requester can automatically skip.
|
|
|
|
approximately 1/3 of the members in the voice channel
|
|
|
|
are required to vote to skip for the song to be skipped.
|
|
|
|
|
|
|
|
EXAMPLE: !skip
|
|
|
|
RESULT: You probably still have to wait for others to skip...have fun listening still
|
|
|
|
"""
|
2016-11-11 16:03:31 +13:00
|
|
|
pass
|
|
|
|
|
|
|
|
@commands.command(pass_context=True, no_pm=True, enabled=False)
|
|
|
|
@checks.custom_perms(kick_members=True)
|
|
|
|
async def modskip(self, ctx):
|
2016-11-29 17:55:55 +13:00
|
|
|
"""Forces a song skip, can only be used by a moderator
|
|
|
|
|
|
|
|
EXAMPLE: !modskip
|
|
|
|
RESULT: No more terrible song :D"""
|
2016-11-11 16:03:31 +13:00
|
|
|
pass
|
|
|
|
|
|
|
|
@commands.command(pass_context=True, no_pm=True, enabled=False)
|
|
|
|
@checks.custom_perms(send_messages=True)
|
|
|
|
async def playing(self, ctx):
|
2016-11-29 17:55:55 +13:00
|
|
|
"""Shows info about the currently played song.
|
|
|
|
|
|
|
|
EXAMPLE: !playing
|
|
|
|
RESULT: Information about the song that's currently playing!"""
|
2016-11-11 16:03:31 +13:00
|
|
|
pass
|
|
|
|
|
2016-11-29 21:05:22 +13:00
|
|
|
|
2016-11-11 16:03:31 +13:00
|
|
|
def setup(bot):
|
|
|
|
bot.add_cog(Music(bot))
|