# Path: utils/checks.py
# class No_Owner(commands.CommandError): pass
# class No_Perms(commands.CommandError): pass
# class No_Role(commands.CommandError): pass
# class No_Admin(commands.CommandError): pass
# class No_Mod(commands.CommandError): pass
# class No_Sup(commands.CommandError): pass
# class No_ServerandPerm(commands.CommandError): pass
# class Nsfw(commands.CommandError): pass
# def is_owner_check(message):
# def is_owner():
# def check_permissions(ctx, perms):
# def role_or_perm(t, ctx, check, **perms):
# def mod_or_perm(**perms):
# 	def predicate(ctx):
# def admin_or_perm(**perms):
# 	def predicate(ctx):
# def is_in_servers(*server_ids):
# 	def predicate(ctx):
# def server_and_perm(ctx, *server_ids, **perms):
# def sup(ctx):
# def nsfw():
# 	def predicate(ctx):
# 
# Path: mods/cog.py
# class Cog(metaclass=CogMeta):
# 	def __init__(self, bot:NotSoBot):
# 		self._bot = bot
# 
# 	@property
# 	def bot(self):
# 		return self._bot
# 
# 	@classmethod
# 	def setup(cls, bot:NotSoBot):
# 		bot.add_cog(cls(bot))


import discord
import time
import requests
import io
from discord.ext import commands
from utils import checks
from mods.cog import Cog
    thing = '{0}\n{1}'.format(max_server.name, max_)
    return max_server.name, max_

  async def get_channels(self):
    text_channels = 0
    voice_channels = 0
    for server in self.bot.servers:
      for channel in server.channels:
        if channel.type == discord.ChannelType.text:
          text_channels += 1
        if channel.type == discord.ChannelType.voice:
          voice_channels += 1
    return text_channels, voice_channels

  async def update_stats(self):
    sql = 'REPLACE INTO `stats` (`shard`, `servers`, `largest_member_server`, `largest_member_server_name`, `users`, `unique_users`, `text_channels`, `voice_channels`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)'
    servers = len(self.bot.servers)
    largest = await self.get_largest_server()
    largest_member_server = largest[1]
    largest_member_server_name = largest[0]
    users_array = [x for x in self.bot.get_all_members()]
    users = len(users_array)
    unique_users = len(set(users_array))
    channels = await self.get_channels()
    text_channels = channels[0]
    voice_channels = channels[1]
    self.cursor.execute(sql, (self.bot.shard_id, servers, largest_member_server, largest_member_server_name, users, unique_users, text_channels, voice_channels))
    self.cursor.commit()

  @commands.command()

# Path: utils/checks.py
# class No_Owner(commands.CommandError): pass
# class No_Perms(commands.CommandError): pass
# class No_Role(commands.CommandError): pass
# class No_Admin(commands.CommandError): pass
# class No_Mod(commands.CommandError): pass
# class No_Sup(commands.CommandError): pass
# class No_ServerandPerm(commands.CommandError): pass
# class Nsfw(commands.CommandError): pass
# def is_owner_check(message):
# def is_owner():
# def check_permissions(ctx, perms):
# def role_or_perm(t, ctx, check, **perms):
# def mod_or_perm(**perms):
# 	def predicate(ctx):
# def admin_or_perm(**perms):
# 	def predicate(ctx):
# def is_in_servers(*server_ids):
# 	def predicate(ctx):
# def server_and_perm(ctx, *server_ids, **perms):
# def sup(ctx):
# def nsfw():
# 	def predicate(ctx):
# 
# Path: mods/cog.py
# class Cog(metaclass=CogMeta):
# 	def __init__(self, bot:NotSoBot):
# 		self._bot = bot
# 
# 	@property
# 	def bot(self):
# 		return self._bot
# 
# 	@classmethod
# 	def setup(cls, bot:NotSoBot):
# 		bot.add_cog(cls(bot))


# Path: mods/Stats.py
import discord
import time
import requests
import io
from discord.ext import commands
from utils import checks
from mods.cog import Cog

    thing = '{0}\n{1}'.format(max_server.name, max_)
    return max_server.name, max_

  async def get_channels(self):
    text_channels = 0
    voice_channels = 0
    for server in self.bot.servers:
      for channel in server.channels:
        if channel.type == discord.ChannelType.text:
          text_channels += 1
        if channel.type == discord.ChannelType.voice:
          voice_channels += 1
    return text_channels, voice_channels

  async def update_stats(self):
    sql = 'REPLACE INTO `stats` (`shard`, `servers`, `largest_member_server`, `largest_member_server_name`, `users`, `unique_users`, `text_channels`, `voice_channels`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)'
    servers = len(self.bot.servers)
    largest = await self.get_largest_server()
    largest_member_server = largest[1]
    largest_member_server_name = largest[0]
    users_array = [x for x in self.bot.get_all_members()]
    users = len(users_array)
    unique_users = len(set(users_array))
    channels = await self.get_channels()
    text_channels = channels[0]
    voice_channels = channels[1]
    self.cursor.execute(sql, (self.bot.shard_id, servers, largest_member_server, largest_member_server_name, users, unique_users, text_channels, voice_channels))
    self.cursor.commit()

  @commands.command()

  @checks.is_owner()