Merge pull request #56 from Klemek/dev

v1.16.1
This commit is contained in:
Klemek
2021-07-13 18:47:12 +02:00
committed by GitHub
3 changed files with 14 additions and 7 deletions
+12 -5
View File
@@ -50,10 +50,9 @@ class Frequency:
fig, ax = plt.subplots()
fig.patch.set_facecolor("#36393F")
ax.patch.set_alpha(0)
times = range(25)
ax.set_xticks(times)
ax.set_xticklabels([f"{t:0>2}h" if t % 2 == 0 else "" for t in times])
for i in range(7):
hours = [self.hours[i][hour] * 7 / n_hours for hour in range(24)] + [
@@ -66,14 +65,22 @@ class Frequency:
hours = [day[hour] / n_hours for hour in range(24)] + [day[0] / n_hours]
ax.plot(times, hours, c="r", label="average", linewidth=1.5)
ax.set_xlabel("hour of day")
fig.patch.set_facecolor("#36393F")
ax.patch.set_alpha(0)
ax.set_xlim([0, 24])
ax.set_ylim([0, None])
ax.set_ylabel("average messages")
ax.legend(framealpha=0)
ax.grid(True, alpha=0.1)
with BytesIO() as f:
plt.savefig(
f, format="png", facecolor=fig.get_facecolor(), edgecolor="none"
f,
format="png",
facecolor=fig.get_facecolor(),
edgecolor="none",
bbox_inches="tight",
dpi=300,
)
f.seek(0)
return [discord.File(f, f"{time.time()}-plot.png")]
+1 -1
View File
@@ -19,7 +19,7 @@ class ChannelLogs:
self.last_message_id = None
self.first_message_id = None
self.format = FORMAT
self.messages = []
self.messages = set()
self.start_date = None
elif isinstance(channel, dict):
self.format = channel["format"] if "format" in channel else None
+1 -1
View File
@@ -18,7 +18,7 @@ emojis.load_emojis()
bot = Bot(
"Discord Analyst",
"1.16",
"1.16.1",
alias="%",
)