Example #1
0
async def main():
    bot = commands.Bot(command_prefix=commands.when_mentioned_or("?"), description="Another random discord bot")
    with open('auth.json') as jf:
        data = json.loads(jf.read())
        bot.key_dis = data['discord']
        bot.key_yt = data['youtube']
        bot.key_azure = data['azure']
    bot.resources = "resources/"
    bot.get_images = utility.get_images
    bot.db = Persistence()
    bot.var = {}

    @bot.event
    async def on_ready():
        for g in bot.guilds:
            bot.var[g.id] = {}
        print("rdy")

    bot.add_cog(Cat(bot))
    bot.add_cog(Image(bot))
    #bot.add_cog(Filter(bot))
    bot.add_cog(Various(bot))
    bot.add_cog(Audio(bot))
    bot.add_cog(Anime(bot))

    try:
        await bot.start(bot.key_dis)
    except KeyboardInterrupt:
        await bot.db.close()
        await bot.logout()
Example #2
0
		trace = [x for x in trace if x] # removes empty lines
	
	trace_string = "\n".join(trace)

	loggingdb.insert_error(message, error, trace_string, loggingdb_session)

	print(f"\nError on: {message.clean_content}\n{trace_string}\n")
	return trace_string

from cogs.general import General
from cogs.audio import Audio
from cogs.dotabase import Dotabase
from cogs.dotastats import DotaStats
from cogs.pokemon import Pokemon
from cogs.artifact import Artifact
from cogs.admin import Admin
from cogs.owner import Owner

if __name__ == '__main__':
	bot.add_cog(General(bot))
	bot.add_cog(Audio(bot))
	bot.add_cog(Dotabase(bot))
	bot.add_cog(DotaStats(bot))
	bot.add_cog(Pokemon(bot))
	bot.add_cog(Artifact(bot))
	bot.add_cog(Admin(bot))
	bot.add_cog(Owner(bot))
	bot.run(settings.token)