mirror of
https://github.com/Paillat-dev/flagger.git
synced 2026-01-02 17:24:57 +00:00
🎉 First commit
This commit is contained in:
21
src/renderer/flag.py
Normal file
21
src/renderer/flag.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Copyright (c) NiceBots
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from dataclasses import dataclass
|
||||
from typing import Literal
|
||||
|
||||
|
||||
@dataclass
|
||||
class Flag:
|
||||
url: str
|
||||
flag_pole_type: Literal["gallery"] = "gallery"
|
||||
background: Literal["blue-sky", "custom"] = "custom"
|
||||
backgroundcolor: str = "1a1a1e"
|
||||
|
||||
def to_url_params(self) -> dict[str, str]:
|
||||
return {
|
||||
"src": self.url,
|
||||
"flagpoletype": self.flag_pole_type,
|
||||
"background": self.background,
|
||||
"backgroundcolor": self.backgroundcolor,
|
||||
}
|
||||
Reference in New Issue
Block a user