pinger_bot.ext.commands.statistic#

Module for the statistic command.

Module Contents#

Functions#

get_not_in_db_embed(→ hikari.embeds.Embed)

Get the embed when a server not in database.

get_yesterday_ping(→ Optional[pinger_bot.models.Ping])

Get the ping from yesterday.

create_plot(→ matplotlib.figure.Figure)

Create plot for the server.

transform_figure_to_bytes(→ io.BytesIO)

Transform Figure to BytesIO.

statistic(→ None)

Some statistic about the server. It's working, even if server is offline.

load(→ None)

Load the plugin.

Attributes#

plugin[source]#

lightbulb.Plugin object.

async get_not_in_db_embed(ip: str) hikari.embeds.Embed[source]#

Get the embed when a server not in database.

See source code for more information.

Parameters:

ip – The IP address of the server to reference in text.

Returns:

The embed where server not in database.

async get_yesterday_ping(pings: List[pinger_bot.models.Ping]) pinger_bot.models.Ping | None[source]#

Get the ping from yesterday.

Yesterday - it is period between 23-25 hours.

Parameters:

pings – List of server’s pings.

Returns:

Ping or None if no yesterday ping.

async create_plot(pings: List[pinger_bot.models.Ping], ip: str) matplotlib.figure.Figure[source]#

Create plot for the server.

Parameters:
  • pings – List of server’s pings.

  • ip – IP of the server, which referenced in text. Better set it to display_ip.

Returns:

Figure object.

async transform_figure_to_bytes(figure: matplotlib.figure.Figure) io.BytesIO[source]#

Transform Figure to BytesIO.

Parameters:

figureFigure of the plot.

Returns:

BytesIO object.

async statistic(ctx: lightbulb.context.slash.SlashContext, ip: str) None[source]#

Some statistic about the server. It’s working, even if server is offline.

Parameters:
  • ctx – The context of the command.

  • ip – The IP address of the server.

load(bot_instance: pinger_bot.bot.PingerBot) None[source]#

Load the plugin.