pinger_bot.ext.commands.other#

Module for other commands.

Warning

This includes some owner-only commands, which will be shown as global. We can’t limit it to specific user ID (because of Discord’s limits), so they will leave for better time.

Module Contents#

Functions#

about(→ None)

Some basic information about me.

invite(→ None)

Link to invite the bot.

get_who_owner_fail_embed(→ hikari.embeds.Embed)

Get the embed for when the IP is not valid.

who_owner(→ None)

Show owner of the server.

git_not_available(→ hikari.embeds.Embed)

Get the embed for when the git is not available.

get_bot_latest_version(→ str)

Get latest commit on master branch and cache it.

bot_version(→ None)

Show bot's version. I mean commit hash which was got with git.

sql_cmd(→ None)

Execute SQL statement to database. Only for owner of the bot.

load(→ None)

Load the plugin.

Attributes#

plugin[source]#

lightbulb.Plugin object.

async about(ctx: lightbulb.context.slash.SlashContext) None[source]#

Some basic information about me.

Parameters:

ctx – The context of the command.

async invite(ctx: lightbulb.context.slash.SlashContext) None[source]#

Link to invite the bot.

Parameters:

ctx – The context of the command.

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

Get the embed for when the IP is not valid.

See source code for more information.

Parameters:

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

Returns:

The embed where command failed.

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

Show owner of the server.

Note

If given IP without :, it will be pinged as Java server. You must specify the port if it is Bedrock server.

Parameters:
  • ctx – The context of the command.

  • ip – The IP address of the server.

async git_not_available() hikari.embeds.Embed[source]#

Get the embed for when the git is not available.

See source code for more information.

Returns:

The embed where command failed.

async get_bot_latest_version() str[source]#

Get latest commit on master branch and cache it.

Cache resets every hour, or every 1024 usages.

Returns:

Short SHA256 of last commit or translated Not available.

async bot_version(ctx) None[source]#

Show bot’s version. I mean commit hash which was got with git.

This also checks if commit.txt exists, which points to the commit hash in Docker. Please do not set this in another way.

async sql_cmd(ctx: lightbulb.context.slash.SlashContext, sql: str, commit: str) None[source]#

Execute SQL statement to database. Only for owner of the bot.

Parameters:
  • ctx – The context of the command.

  • sql – SQL statement provided by user.

  • commit – Commit changes to database. Type str because we pass here translated Yes or No.

Returns:

The result of the SQL statement in JSON format if all parameter is Yes. Else - Done! message.

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

Load the plugin.