async def _list(self, ctx): """Lists the top Gods on the server.""" gods = database.getGods(ctx.guild.id) if not gods: await ctx.send("There are no Gods in " + ctx.guild.name + ", yet... `/gods create <name>`") return gods = list(gods) i = 1 godlist = "" for god in gods: if i > 15: break believers = database.getBelieversByID(god.ID) if not believers: believers = 0 else: believers = len(database.getBelieversByID(god.ID)) godtext = str("[" + str(i) + "] > #" + god.Name + "\n" " " + botutils.getGodString(god) + " of " + god.Type.capitalize() + "\n" " Power: " + str(round(god.Power, 2)) + "\n" " Believers: " + str(believers) + "\n") godlist = godlist + godtext i += 1 await ctx.send("**The Gods of " + ctx.guild.name + "**\n\n" "```pl\n" + godlist + "```")
async def on_guild_remove(guild): await logger.log("Left a new guild (`%s` - `%s`)" % (guild.name, guild.id), bot, "INFO") # Disband any gods in the guild gods = database.getGods(guild.id) if gods: for god in gods: botutils.disbandGod(god.ID)