# Title: boy.py
# Author: Benjamin Smith
# Date: September 20 2017
# 
# Purpose: 
# 

import discord, logging, json, asyncio
from tok import TOKEN
from discord.ext import commands

# 
#client = discord.Client()
description = "csci_bots\n\n Commands:\n ?hello\n"
bot = commands.Bot(command_prefix='?', description = description)

# logging
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
logger.addHandler(handler)


class Bot:
	# 
	@bot.event
	async def on_ready():
		print("Initiating Bot:")
		print(bot.user.name)
		print(bot.user.id)
		#bot.ClientException()

	@bot.command()
	async def hello():
		await bot.say("Hello Humans")

	@bot.command()
	async def who():
		await bot.say(bot.user.name)

	@bot.command()
	async def report():
		for server in bot.servers:
			if server.owner: #currently always true
				await bot.say("Members on this sever:")
				count = "#",server.member_count
				await bot.say(count)
				for member in server.members:
					mem = member
					await bot.say(mem)
			else: 
				await bot.say("Don't tell me what to do")


	@bot.command()
	async def 

	# Run bot
	bot.run(TOKEN)
