1
0
Fork 0
mirror of synced 2024-06-26 18:21:15 +12:00

Corrected issue where the banner creation method wasn't found

This commit is contained in:
Phxntxm 2017-02-12 15:45:11 -06:00
parent 5561115449
commit a40ca62583

View file

@ -1,7 +1,6 @@
import discord
from discord.ext import commands
from . import utils
import re
@ -97,7 +96,7 @@ class Stats:
("Total Usage", total_usage),
("Your Usage", member_usage),
("This Server's Usage", server_usage)]
banner = await images.create_banner(ctx.message.author, "Command Stats", data)
banner = await utils.create_banner(ctx.message.author, "Command Stats", data)
await self.bot.upload(banner)
except (FileNotFoundError, discord.Forbidden):
fmt = "The command {} has been used a total of {} times\n" \
@ -132,7 +131,7 @@ class Stats:
# As this can include, for example, all 3 if there are only 3 entries
try:
top_5 = [(data[0], data[1]) for data in sorted_stats[:5]]
banner = await images.create_banner(ctx.message.author, "Your command usage", top_5)
banner = await utils.create_banner(ctx.message.author, "Your command usage", top_5)
await self.bot.upload(banner)
except (FileNotFoundError, discord.Forbidden):
top_5 = "\n".join("{}: {}".format(data[0], data[1]) for data in sorted_stats[:5])
@ -209,7 +208,7 @@ class Stats:
try:
output = [("{0.display_name}".format(ctx.message.server.get_member(m_id)), amt)
for m_id, amt in sorted_booped_members]
banner = await images.create_banner(ctx.message.author, "Your booped victims", output)
banner = await utils.create_banner(ctx.message.author, "Your booped victims", output)
await self.bot.upload(banner)
except (FileNotFoundError, discord.Forbidden):
output = "\n".join(
@ -279,7 +278,7 @@ class Stats:
title = 'Stats for {}'.format(member.display_name)
fmt = [('Record', record), ('Server Rank', '{}/{}'.format(server_rank, len(server_members))),
('Overall Rank', '{}/{}'.format(total_rank, len(all_members))), ('Rating', rating)]
banner = await images.create_banner(member, title, fmt)
banner = await utils.create_banner(member, title, fmt)
await self.bot.upload(banner)
except (FileNotFoundError, discord.Forbidden):
fmt = 'Stats for {}:\n\tRecord: {}\n\tServer Rank: {}/{}\n\tOverall Rank: {}/{}\n\tRating: {}'