Funstuff.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:Luna 作者: Moonlington 项目源码 文件源码
def plotjoins(self, ctx):
        """Plots the joindates of everyone in the server"""
        sm = ctx.message.server.members
        x = sorted([m.joined_at for m in sm])
        y = range(len(x))
        plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%m/%d/%Y'))
        plt.plot(x, y)
        plt.gcf().autofmt_xdate()
        plt.title("Plot of joins from {}".format(ctx.message.server.name))
        buf = BytesIO()
        plt.savefig(buf, format='png')
        buf.seek(0)
        await self.bot.upload(buf, filename='plot.png')
        buf.close()
        plt.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号