14 lines
257 B
Python
14 lines
257 B
Python
from dataclasses import dataclass
|
|
|
|
import yaml
|
|
|
|
|
|
@dataclass
|
|
class Config:
|
|
discord_token: str
|
|
|
|
@classmethod
|
|
def load(cls, filename) -> "Config":
|
|
with open(filename) as config_file:
|
|
return Config(**yaml.safe_load(config_file))
|