diff options
author | nico <nico@magicbroccoli.de> | 2019-12-23 02:03:34 +0100 |
---|---|---|
committer | nico <nico@magicbroccoli.de> | 2019-12-23 02:03:34 +0100 |
commit | f1612a726a48c41511239f95e771dbafc4764cc6 (patch) | |
tree | 5086d5cf29186967b271426c02457747fd8161d0 /README.md | |
parent | 150002e1434bcc69694232436b9894358bed8826 (diff) |
nickname and readme0.1.1
+ add friendly client_nickname the bot assigns itself
* small readme updates
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -1,24 +1,26 @@ # TeamSpeak GroupAssigner -[![CodeFactor](https://www.codefactor.io/repository/github/mightybroccoli/tsgroupassigner/badge)](https://www.codefactor.io/repository/github/mightybroccoli/tsgroupassigner) +[![PyPI](https://img.shields.io/pypi/v/TSGroupAssigner.svg)](https://pypi.python.org/pypi/TSGroupAssigner) +[![PyPI](https://img.shields.io/pypi/pyversions/TSGroupAssigner.svg)](https://pypi.python.org/pypi/TSGroupAssigner) +[![CodeFactor](https://www.codefactor.io/repository/github/mightybroccoli/TSGroupAssigner/badge)](https://www.codefactor.io/repository/github/mightybroccoli/TSGroupAssigner) ## Overview TSGroupAssigner is a module which allows to automatically assign server groups to voice clients, if they connect within -a specified date range. +a specific date range. -### example -This small example could be called on the 23.12 to assign the group `24` to every voice client connecting +### example +This small example script could be called before christmas to assign the group `24` to every voice client connecting to the server id `1`. -The process will terminate gracefully when the configured date range is exceeded. +The process will terminate gracefully, when the configured date range is exceeded. ```python import datetime as dt import logging -from TSGroupAssigner import GroupAssigner +from TSGroupAssigner import GroupAssigner, DateException logger = logging.getLogger() logger.setLevel(logging.INFO) -creds = { +params = { 'host': 'localhost', 'port': 10011, 'user': 'serveradmin', @@ -30,5 +32,8 @@ creds = { target = dt.date(year=2019, month=24, day=12) duration = dt.timedelta(days=2) -GroupAssigner(date=target, delta=duration, **creds).start() +try: + GroupAssigner(date=target, delta=duration, **params).start() +except DateException as err: + logger.error(err) ``` |