1
0
Fork 0
mirror of synced 2024-06-28 11:10:27 +12:00
This commit is contained in:
Phxntxm 2016-10-16 19:58:27 -05:00
commit e0807de375
47 changed files with 18 additions and 14 deletions

2
.gitignore vendored
View file

@ -8,7 +8,7 @@ GitAutoDeploy.conf.json
.htaccess
autoupdate.php
error_log
images/*
images/banner/tmp/*
.ftpquota
bonfire.log
*.sublime-*

View file

@ -8,9 +8,14 @@ https://discordapp.com/oauth2/authorize?client_id=183748889814237186&scope=bot&p
This requires the discord.py library, as well as all of it's dependencies.
https://github.com/Rapptz/discord.py
I also use the pendulum library, which can be installed using pip.
To save the data for the bot, rethinkdb is what is used:
https://www.rethinkdb.com/docs/install/
I also use a few libraries that aren't included by default, which can be installed using pip.
```
pip install pendulum
python3.5 -m pip install rethinkdb pendulum ruamel.yaml Pillow
# Or on windows
py -3 -m pip install rethinkdb pendulum ruamel.yaml Pillow
```
The only required file to modify would be the config.yml.sample file. The entries are as follows:

View file

@ -86,11 +86,10 @@ class Overwatch:
if data['general_stats'].get('eliminations') and data['general_stats'].get('deaths'):
output_data["Kill Death Ratio"] = "{0:.2f}".format(
data['general_stats'].get('eliminations') / data['general_stats'].get('deaths'))
if ctx.message.channel.is_private or ctx.message.channel.permissions_for(ctx.message.server.me).attach_files:
try:
banner = await images.create_banner(user, "Overwatch", output_data)
await self.bot.upload(banner)
else:
except (FileNotFoundError, discord.Forbidden):
fmt = "\n".join("{}: {}".format(k, r) for k, r in output_data)
await self.bot.say("Overwatch stats for {}: ```py\n{}```".format(user.name, fmt))

View file

@ -54,14 +54,14 @@ class Stats:
member_usage = command_stats['member_usage'].get(ctx.message.author.id, 0)
server_usage = command_stats['server_usage'].get(ctx.message.server.id, 0)
if ctx.message.channel.permissions_for(ctx.message.server.me).attach_files:
try:
data = {"Command Name": cmd.qualified_name,
"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)
await self.bot.upload(banner)
else:
except (FileNotFoundError, discord.Forbidden):
fmt = "The command {} has been used a total of {} times\n" \
"{} times on this server\n" \
"It has been ran by you, {}, {} times".format(cmd.qualified_name, total_usage, server_usage,
@ -89,11 +89,11 @@ class Stats:
# Create a string, each command on it's own line, based on the top 5 used commands
# I'm letting it use the length of the sorted_stats[:5]
# As this can include, for example, all 3 if there are only 3 entries
if ctx.message.channel.permissions_for(ctx.message.server.me).attach_files:
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)
await self.bot.upload(banner)
else:
except (FileNotFoundError, discord.Forbidden):
top_5 = "\n".join("{}: {}".format(data[0], data[1]) for data in sorted_stats[:5])
await self.bot.say("Your top {} most used commands are:\n```\n{}```".format(len(sorted_stats[:5]), top_5))
elif re.search('server', option):
@ -158,12 +158,12 @@ class Stats:
# Now we only want the first 10 members, so splice this list
sorted_booped_members = sorted_booped_members[:10]
if ctx.message.channel.permissions_for(ctx.message.server.me).attach_files:
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)
await self.bot.upload(banner)
else:
except (FileNotFoundError, discord.Forbidden):
output = "\n".join(
"{0.display_name}: {1} times".format(ctx.message.server.get_member(m_id), amt) for
m_id, amt in sorted_booped_members)
@ -192,10 +192,10 @@ class Stats:
if count >= 11:
break
if ctx.message.channel.permissions_for(ctx.message.server.me).attach_files:
try:
banner = await images.create_banner(ctx.message.author, "Battling Leaderboard", output)
await self.bot.upload(banner)
else:
except (FileNotFoundError, discord.Forbidden):
fmt = "\n".join("#{}) {}".format(key, value) for key, value in output.items())
await self.bot.say("Battling leaderboard for this server:```\n{}```".format(fmt))

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
images/banner/base/mask.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
images/doggo0.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
images/doggo1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
images/doggo10.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
images/doggo11.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
images/doggo12.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
images/doggo13.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
images/doggo14.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
images/doggo15.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

BIN
images/doggo16.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

BIN
images/doggo17.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
images/doggo18.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
images/doggo2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
images/doggo3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
images/doggo4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
images/doggo5.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
images/doggo6.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

BIN
images/doggo7.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
images/doggo8.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

BIN
images/doggo9.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

BIN
images/snek0.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

BIN
images/snek1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 KiB

BIN
images/snek10.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 KiB

BIN
images/snek11.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
images/snek12.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/snek13.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

BIN
images/snek14.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
images/snek15.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 KiB

BIN
images/snek16.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

BIN
images/snek17.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
images/snek18.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
images/snek19.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
images/snek2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

BIN
images/snek3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/snek4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
images/snek5.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 KiB

BIN
images/snek6.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

BIN
images/snek7.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

BIN
images/snek8.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

BIN
images/snek9.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB