# Path: dozer/cogs/info.py
# class Info(Cog):
#     async def slash_member(self, ctx: SlashContext, member: discord.Member = None):
#     async def member(self, ctx, *, member: discord.Member = None):
#     def _format_activities(activities: typing.Sequence[discord.Activity]) -> typing.List[str]:
#         def format_activity(activity: discord.Activity) -> str:
#     def pluralize(values: typing.List[str]) -> str:
#     async def slash_role(self, ctx: SlashContext, role: discord.Role):
#     async def role(self, ctx, role: discord.Role):
#     async def slash_rolemember(self, ctx: SlashContext, role: discord.Role):
#     async def rolemembers(self, ctx, role: discord.Role):
#     async def slash_guild(self, ctx: SlashContext):
#     async def guild(self, ctx):
# def setup(bot):


import discord
from discord.ext.commands import has_permissions, BadArgument
from ._utils import *
from .info import blurple
from .. import db
    async def voicebindlist(self, ctx):
        """Lists all the voice channel to role bindings for the current server"""
        embed = discord.Embed(title="List of voice bindings for \"{}\"".format(ctx.guild), color=discord.Color.blue())
        for config in await Voicebinds.get_by(guild_id=ctx.guild.id):
            channel = discord.utils.get(ctx.guild.voice_channels, id=config.channel_id)
            role = ctx.guild.get_role(config.role_id)
            embed.add_field(name=channel, value="`{}`".format(role))
        await ctx.send(embed=embed)

    voicebindlist.example_usage = """
    `{prefix}voicebindlist` - Lists all the voice channel to role bindings for the current server bound with the voicebind command.
    """


class Voicebinds(db.DatabaseTable):
    """DB object to keep track of voice to text channel access bindings."""
    __tablename__ = 'voicebinds'

    __uniques__ = 'id'

    @classmethod
    async def initial_create(cls):
        """Create the table in the database"""
        async with db.Pool.acquire() as conn:
            await conn.execute(f"""
            CREATE TABLE {cls.__tablename__} (
            id SERIAL PRIMARY KEY NOT NULL,
            guild_id bigint NOT NULL,
            channel_id bigint null,
            role_id bigint null

# Path: dozer/cogs/info.py
# class Info(Cog):
#     async def slash_member(self, ctx: SlashContext, member: discord.Member = None):
#     async def member(self, ctx, *, member: discord.Member = None):
#     def _format_activities(activities: typing.Sequence[discord.Activity]) -> typing.List[str]:
#         def format_activity(activity: discord.Activity) -> str:
#     def pluralize(values: typing.List[str]) -> str:
#     async def slash_role(self, ctx: SlashContext, role: discord.Role):
#     async def role(self, ctx, role: discord.Role):
#     async def slash_rolemember(self, ctx: SlashContext, role: discord.Role):
#     async def rolemembers(self, ctx, role: discord.Role):
#     async def slash_guild(self, ctx: SlashContext):
#     async def guild(self, ctx):
# def setup(bot):


# Path: dozer/cogs/voice.py
import discord
from discord.ext.commands import has_permissions, BadArgument
from ._utils import *
from .info import blurple
from .. import db

    async def voicebindlist(self, ctx):
        """Lists all the voice channel to role bindings for the current server"""
        embed = discord.Embed(title="List of voice bindings for \"{}\"".format(ctx.guild), color=discord.Color.blue())
        for config in await Voicebinds.get_by(guild_id=ctx.guild.id):
            channel = discord.utils.get(ctx.guild.voice_channels, id=config.channel_id)
            role = ctx.guild.get_role(config.role_id)
            embed.add_field(name=channel, value="`{}`".format(role))
        await ctx.send(embed=embed)

    voicebindlist.example_usage = """
    `{prefix}voicebindlist` - Lists all the voice channel to role bindings for the current server bound with the voicebind command.
    """


class Voicebinds(db.DatabaseTable):
    """DB object to keep track of voice to text channel access bindings."""
    __tablename__ = 'voicebinds'

    __uniques__ = 'id'

    @classmethod
    async def initial_create(cls):
        """Create the table in the database"""
        async with db.Pool.acquire() as conn:
            await conn.execute(f"""
            CREATE TABLE {cls.__tablename__} (
            id SERIAL PRIMARY KEY NOT NULL,
            guild_id bigint NOT NULL,
            channel_id bigint null,
            role_id bigint null

            )""")