1
0
Fork 0
mirror of synced 2024-06-18 18:44:33 +12:00

Removed the change Pycharm made for pep8 which caused the bot not to run, as the directoy was detected incorrectly

This commit is contained in:
phxntxm 2016-08-26 08:23:02 -05:00
parent 217407fbaa
commit b082ce5f04
3 changed files with 34 additions and 19 deletions

7
bot.py
View file

@ -1,8 +1,4 @@
#!/usr/local/bin/python3.5 #!/usr/local/bin/python3.5
from discord.ext import commands
from cogs.utils import config
import discord import discord
import traceback import traceback
import logging import logging
@ -12,6 +8,9 @@ import os
os.chdir(os.path.dirname(os.path.realpath(__file__))) os.chdir(os.path.dirname(os.path.realpath(__file__)))
from discord.ext import commands
from cogs.utils import config
extensions = ['cogs.interaction', extensions = ['cogs.interaction',
'cogs.core', 'cogs.core',
'cogs.mod', 'cogs.mod',

View file

@ -4,7 +4,6 @@ from .utils import checks
from .utils import config from .utils import config
import subprocess import subprocess
import os
import glob import glob
import random import random
import re import re
@ -25,7 +24,8 @@ class Core:
"""Provides a printout of the current month's calendar """Provides a printout of the current month's calendar
Provide month and year to print the calendar of that year and month""" Provide month and year to print the calendar of that year and month"""
# calendar takes in a number for the month, not the words, so we need this dictionary to transform the word to the number # calendar takes in a number for the month, not the words
# so we need this dictionary to transform the word to the number
months = { months = {
"january": 1, "january": 1,
"february": 2, "february": 2,
@ -65,7 +65,6 @@ class Core:
all_members = list(self.bot.get_all_members()) all_members = list(self.bot.get_all_members())
# We can pretty safely assume that the author is going to be in at least one channel with the bot # We can pretty safely assume that the author is going to be in at least one channel with the bot
# So find the author based on that list # So find the author based on that list
authors = [] authors = []
@ -79,7 +78,25 @@ class Core:
fmt['Total Members'] = len(all_members) fmt['Total Members'] = len(all_members)
fmt['Description'] = self.bot.description fmt['Description'] = self.bot.description
servers_playing_music = len([server_id for server_id, state in self.bot.get_cog('Music').voice_states.items() if
state.is_playing()])
hm_games = len([server_id for server_id, game in self.bot.get_cog('Hangman').games.items()])
ttt_games = len([server_id for server_id, game in self.bot.get_cog('TicTacToe').boards.items()])
count_battles = 0
for battles in self.bot.get_cog('Interaction').battles.values():
count_battles += len(battles)
information = "\n".join("{}: {}".format(key, result) for key, result in fmt.items()) information = "\n".join("{}: {}".format(key, result) for key, result in fmt.items())
information += "\n"
if servers_playing_music:
information += "Playing songs in {} different servers\n".format(servers_playing_music)
if hm_games:
information += "{} different hangman games running\n".format(hm_games)
if ttt_games:
information += "{} different TicTacToe games running\n".format(ttt_games)
if count_battles:
information += "{} different battles going on\n".format(count_battles)
await self.bot.say("```\n{}```".format(information)) await self.bot.say("```\n{}```".format(information))
@commands.command() @commands.command()

View file

@ -1,7 +1,6 @@
from discord.ext import commands from discord.ext import commands
from .utils import checks from .utils import checks
from .utils import config from .utils import config
import discord import discord
import re import re
import asyncio import asyncio