mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 00:07:55 +00:00
Move System and Member to separate files
This commit is contained in:
parent
138c0b7f8c
commit
49b4e4c1ef
9 changed files with 66 additions and 53 deletions
31
src/pluralkit/member.py
Normal file
31
src/pluralkit/member.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
from datetime import date, datetime
|
||||
|
||||
from collections.__init__ import namedtuple
|
||||
|
||||
|
||||
class Member(namedtuple("Member", ["id", "hid", "system", "color", "avatar_url", "name", "birthday", "pronouns", "description", "prefix", "suffix", "created"])):
|
||||
id: int
|
||||
hid: str
|
||||
system: int
|
||||
color: str
|
||||
avatar_url: str
|
||||
name: str
|
||||
birthday: date
|
||||
pronouns: str
|
||||
description: str
|
||||
prefix: str
|
||||
suffix: str
|
||||
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