mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 08:40:11 +00:00
Add basic HTTP API
This commit is contained in:
parent
e831ef5921
commit
944f0093a9
13 changed files with 238 additions and 51 deletions
|
|
@ -4,6 +4,7 @@ from urllib.parse import urlparse
|
|||
|
||||
import humanize
|
||||
|
||||
import pluralkit.utils
|
||||
from pluralkit.bot import utils
|
||||
from pluralkit.bot.commands import *
|
||||
|
||||
|
|
@ -153,7 +154,7 @@ async def system_fronter(ctx: CommandContext, args: List[str]):
|
|||
if system is None:
|
||||
raise CommandError("Can't find system \"{}\".".format(args[0]))
|
||||
|
||||
fronters, timestamp = await utils.get_fronters(ctx.conn, system_id=system.id)
|
||||
fronters, timestamp = await pluralkit.utils.get_fronters(ctx.conn, system_id=system.id)
|
||||
fronter_names = [member.name for member in fronters]
|
||||
|
||||
embed = utils.make_default_embed(None)
|
||||
|
|
@ -182,7 +183,7 @@ async def system_fronthistory(ctx: CommandContext, args: List[str]):
|
|||
raise CommandError("Can't find system \"{}\".".format(args[0]))
|
||||
|
||||
lines = []
|
||||
front_history = await utils.get_front_history(ctx.conn, system.id, count=10)
|
||||
front_history = await pluralkit.utils.get_front_history(ctx.conn, system.id, count=10)
|
||||
for i, (timestamp, members) in enumerate(front_history):
|
||||
# Special case when no one's fronting
|
||||
if len(members) == 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue