added getter for client name
This commit is contained in:
parent
e1194a0c4f
commit
d3618b08ea
1 changed files with 8 additions and 0 deletions
|
@ -79,6 +79,14 @@ class Treepuncher(MinecraftClient):
|
||||||
logging.getLogger('apscheduler.executors.default').setLevel(logging.WARNING) # So it's way less spammy
|
logging.getLogger('apscheduler.executors.default').setLevel(logging.WARNING) # So it's way less spammy
|
||||||
self.scheduler.start(paused=True)
|
self.scheduler.start(paused=True)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self) -> str:
|
||||||
|
if self.online_mode and self.token:
|
||||||
|
return self.token.profile.name
|
||||||
|
if not self.online_mode and self.username:
|
||||||
|
return self.username
|
||||||
|
raise ValueError("No token or username given")
|
||||||
|
|
||||||
async def start(self):
|
async def start(self):
|
||||||
for m in self.modules:
|
for m in self.modules:
|
||||||
await m.initialize(self)
|
await m.initialize(self)
|
||||||
|
|
Loading…
Reference in a new issue