Fixing last commit
This commit is contained in:
@@ -8,9 +8,10 @@ https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||
# IMPORTS - external
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import platform
|
||||
|
||||
# IMPORTS - internal
|
||||
from aquabot import metadata
|
||||
import loadconfig
|
||||
|
||||
# COG INIT
|
||||
class General(commands.Cog):
|
||||
@@ -24,23 +25,23 @@ class General(commands.Cog):
|
||||
Prints some information about myself
|
||||
"""
|
||||
embed = discord.Embed(colour=discord.Colour.blue())
|
||||
embed.set_thumbnail(url=ctx.me.avatar_url)
|
||||
|
||||
embed.add_field(name="Bot Name", value=metadata["name"], inline=True)
|
||||
embed.add_field(name="Admin", value=metadata["admin"], inline=True)
|
||||
embed.add_field(name="Prefix", value=metadata["prefix"], inline=True)
|
||||
embed.add_field(name="discord.py Version", value=metadata["discordpy_version"], inline=True)
|
||||
embed.add_field(name="python Version", value=metadata["python_version"], inline=True)
|
||||
embed.add_field(name="OS", value=metadata["os"], inline=True)
|
||||
embed.add_field(name="Owner", value=self.bot.AppInfo.owner, inline=True)
|
||||
embed.add_field(name="Command Prefix", value=loadconfig.__prefix__, inline=True)
|
||||
embed.add_field(name="Discord.py Version", value=discord.__version__, inline=True)
|
||||
embed.add_field(name="Python Version", value=platform.python_version(), inline=True)
|
||||
embed.add_field(name="OS", value=f"{platform.system()} {platform.release()} {platform.version()}", inline=True)
|
||||
|
||||
footer_text = """
|
||||
This Bot is an OpenSource project by Marc and can be found on
|
||||
github.com/CramMK/aquabot
|
||||
"""
|
||||
embed.set_footer(text=footer_text, icon_url="img/avatar.png")
|
||||
footer_text = (
|
||||
"This Bot is an OpenSource project by Marc and can be found "
|
||||
"on github.com/CramMK/aquabot"
|
||||
)
|
||||
embed.set_footer(text=footer_text, icon_url=loadconfig.__avatar__)
|
||||
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
|
||||
# COG ENDING
|
||||
def setup(bot):
|
||||
bot.add_cog(General(bot))
|
||||
bot.add_cog(General(bot))
|
||||
@@ -20,55 +20,49 @@ class Voice(commands.Cog):
|
||||
# COG BODY
|
||||
@commands.command(name="join", aliases=["j"])
|
||||
@commands.guild_only()
|
||||
async def join(self, ctx):
|
||||
"""
|
||||
Tries to join the author's current voice channel
|
||||
"""
|
||||
channel = ctx.message.author.voice.channel
|
||||
if not channel:
|
||||
ctx.send:("You're not connected to a voice channel!")
|
||||
return
|
||||
async def join(self, ctx):
|
||||
"""
|
||||
Tries to join the author's current voice channel
|
||||
"""
|
||||
channel = ctx.message.author.voice.channel
|
||||
if not channel:
|
||||
ctx.send:("You're not connected to a voice channel!")
|
||||
return
|
||||
|
||||
voice = get(bot.voice_clients, guild=ctx.guild)
|
||||
voice = get(self.bot.voice_clients, guild=ctx.guild)
|
||||
|
||||
if voice and voice.is_connected():
|
||||
await voice.move_to(channel)
|
||||
else:
|
||||
voice = await channel.connect()
|
||||
await ctx.send(f"`Joined {channel}!`")
|
||||
""" useless?
|
||||
await voice.disconnect()
|
||||
|
||||
if voice and voice.is_connected():
|
||||
await voice.move_to(channel)
|
||||
else:
|
||||
voice = await channel.connect()
|
||||
if voice and voice.is_connected():
|
||||
await voice.move_to(channel)
|
||||
await ctx.send(f"`Move to {channel}!`")
|
||||
else:
|
||||
voice = await channel.connect()
|
||||
await ctx.send(f"`Joined {channel}!`")
|
||||
"""
|
||||
|
||||
|
||||
@commands.command(name="leave", aliases=["quit, l"])
|
||||
@commands.guild_only()
|
||||
async def leave(self, ctx):
|
||||
"""
|
||||
Leaves the voice channel, if connected
|
||||
"""
|
||||
channel = ctx.message.author.voice.channel
|
||||
voice = get(bot.voice_clients, guild=ctx.guild)
|
||||
async def leave(self, ctx):
|
||||
"""
|
||||
Leaves the voice channel, if connected
|
||||
"""
|
||||
channel = ctx.message.author.voice.channel
|
||||
voice = get(self.bot.voice_clients, guild=ctx.guild)
|
||||
|
||||
if voice and voice.is_connected():
|
||||
await voice.disconnect()
|
||||
await ctx.send(f"`Left {channel}!`")
|
||||
else:
|
||||
await ctx.send("I'm not connected to a channel!")
|
||||
|
||||
if voice and voice.is_connected():
|
||||
await voice.disconnect()
|
||||
await ctx.send(f"`Left {channel}!`")
|
||||
else:
|
||||
ctx.send("I'm not connected to a channel!")
|
||||
|
||||
@commands.command(name="play", aliases=["p"])
|
||||
@commands.guild_only()
|
||||
async def play(self, ctx, url: str):
|
||||
"""
|
||||
Plays music from YT link specifies
|
||||
"""
|
||||
# TODO
|
||||
ctx.send("This module is not working yet!")
|
||||
async def play(self, ctx, url: str):
|
||||
"""
|
||||
Plays music from YT link specifies
|
||||
"""
|
||||
# TODO
|
||||
ctx.send("This module is not working yet!")
|
||||
|
||||
|
||||
# COG ENDING
|
||||
|
||||
Reference in New Issue
Block a user