mirror of
https://github.com/brandons209/Red-bot-Cogs.git
synced 2024-09-28 07:11:47 +12:00
bug fixes
This commit is contained in:
parent
97e2ff9253
commit
d0ec8fe40b
1 changed files with 18 additions and 5 deletions
|
@ -486,7 +486,7 @@ class ActivityLogger(commands.Cog):
|
||||||
)
|
)
|
||||||
plt.xlabel("Channel", fontsize=fontsize)
|
plt.xlabel("Channel", fontsize=fontsize)
|
||||||
plt.ylabel("Time spent in voice chat (minutes)", fontsize=fontsize)
|
plt.ylabel("Time spent in voice chat (minutes)", fontsize=fontsize)
|
||||||
plt.xticks(fontsize=fontsize)
|
plt.xticks(["\n".join(str(s).split(" ")) for s in df.index], fontsize=fontsize)
|
||||||
plt.yticks(fontsize=fontsize)
|
plt.yticks(fontsize=fontsize)
|
||||||
plt.grid(True)
|
plt.grid(True)
|
||||||
|
|
||||||
|
@ -1098,7 +1098,10 @@ class ActivityLogger(commands.Cog):
|
||||||
for ch_id, msgs in messages.items():
|
for ch_id, msgs in messages.items():
|
||||||
for message in msgs:
|
for message in msgs:
|
||||||
# grab time of the message
|
# grab time of the message
|
||||||
|
try:
|
||||||
current_time = parse_time_naive(message[:19])
|
current_time = parse_time_naive(message[:19])
|
||||||
|
except:
|
||||||
|
continue
|
||||||
# find what time to put it in using binary search
|
# find what time to put it in using binary search
|
||||||
index = bisect_left(data["times"], current_time) - 1
|
index = bisect_left(data["times"], current_time) - 1
|
||||||
# add message to channel
|
# add message to channel
|
||||||
|
@ -1276,7 +1279,7 @@ class ActivityLogger(commands.Cog):
|
||||||
@graphstats_users.command(name="guild")
|
@graphstats_users.command(name="guild")
|
||||||
async def graphstats_users_guild(self, ctx, *, till: str):
|
async def graphstats_users_guild(self, ctx, *, till: str):
|
||||||
"""
|
"""
|
||||||
Create a pie chart of most active users in the guild
|
Create a bar graph of most active users in the guild
|
||||||
|
|
||||||
`till` can be a date or interval
|
`till` can be a date or interval
|
||||||
|
|
||||||
|
@ -1462,7 +1465,10 @@ class ActivityLogger(commands.Cog):
|
||||||
|
|
||||||
for message in messages:
|
for message in messages:
|
||||||
# get hour:
|
# get hour:
|
||||||
|
try:
|
||||||
hour = int(message[11:13])
|
hour = int(message[11:13])
|
||||||
|
except:
|
||||||
|
continue
|
||||||
data["num_messages"][hour] += 1
|
data["num_messages"][hour] += 1
|
||||||
|
|
||||||
# voice channels and minutes spent in channel per channel
|
# voice channels and minutes spent in channel per channel
|
||||||
|
@ -1581,7 +1587,10 @@ class ActivityLogger(commands.Cog):
|
||||||
|
|
||||||
for message in messages:
|
for message in messages:
|
||||||
# get hour:
|
# get hour:
|
||||||
|
try:
|
||||||
hour = int(message[11:13])
|
hour = int(message[11:13])
|
||||||
|
except:
|
||||||
|
continue
|
||||||
data["num_messages"][hour] += 1
|
data["num_messages"][hour] += 1
|
||||||
|
|
||||||
df = pd.DataFrame(data)
|
df = pd.DataFrame(data)
|
||||||
|
@ -1718,6 +1727,10 @@ class ActivityLogger(commands.Cog):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
for message in data:
|
for message in data:
|
||||||
|
try:
|
||||||
|
message.split("(id:")[1].split("):")[0]
|
||||||
|
except:
|
||||||
|
continue
|
||||||
if "replied to" in message.split("(id:")[1].split("):")[0]:
|
if "replied to" in message.split("(id:")[1].split("):")[0]:
|
||||||
|
|
||||||
# add correlation to matrix
|
# add correlation to matrix
|
||||||
|
|
Loading…
Reference in a new issue