mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-14 01:30:13 +00:00
Add basic HTTP API
This commit is contained in:
parent
e831ef5921
commit
944f0093a9
13 changed files with 238 additions and 51 deletions
|
|
@ -11,6 +11,15 @@ class System(namedtuple("System", ["id", "hid", "name", "description", "tag", "a
|
|||
avatar_url: str
|
||||
created: datetime
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
"id": self.hid,
|
||||
"name": self.name,
|
||||
"description": self.description,
|
||||
"tag": self.tag,
|
||||
"avatar_url": self.avatar_url
|
||||
}
|
||||
|
||||
class Member(namedtuple("Member", ["id", "hid", "system", "color", "avatar_url", "name", "birthday", "pronouns", "description", "prefix", "suffix", "created"])):
|
||||
id: int
|
||||
hid: str
|
||||
|
|
@ -23,4 +32,17 @@ class Member(namedtuple("Member", ["id", "hid", "system", "color", "avatar_url",
|
|||
description: str
|
||||
prefix: str
|
||||
suffix: str
|
||||
created: datetime
|
||||
created: datetime
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
"id": self.hid,
|
||||
"name": self.name,
|
||||
"color": self.color,
|
||||
"avatar_url": self.avatar_url,
|
||||
"birthday": self.birthday.isoformat() if self.birthday else None,
|
||||
"pronouns": self.pronouns,
|
||||
"description": self.description,
|
||||
"prefix": self.prefix,
|
||||
"suffix": self.suffix
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue