add tokens
This commit is contained in:
parent
7dedb7a0b8
commit
d5978a3371
1 changed files with 9 additions and 2 deletions
|
@ -34,6 +34,7 @@ def get_parser():
|
|||
parser.add_argument("--channel", help="Set channel", default="")
|
||||
parser.add_argument("--name", help="Set bot nickname", default="RadioRobbot")
|
||||
parser.add_argument("--server", help="Set server", default="mumble.esiliati.org")
|
||||
parser.add_argument("--password", help="Set password", default="")
|
||||
parser.add_argument("--port", help="Set port", type=int, default=64738)
|
||||
parser.add_argument(
|
||||
"--stream",
|
||||
|
@ -48,6 +49,11 @@ def get_parser():
|
|||
parser.add_argument(
|
||||
"--max-silence-time", type=int, help="max silence time in seconds", default=30
|
||||
)
|
||||
parser.add_argument(
|
||||
"--tokens",
|
||||
help="Set tokens list",
|
||||
nargs="*"
|
||||
)
|
||||
return parser
|
||||
|
||||
|
||||
|
@ -57,16 +63,17 @@ def main():
|
|||
args = get_parser().parse_args()
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
pwd = "" # password
|
||||
pwd = args.password
|
||||
server = args.server
|
||||
nick = args.name
|
||||
channel = args.channel
|
||||
port = args.port
|
||||
tokens = args.tokens
|
||||
is_streaming = False
|
||||
stream_always = args.stream
|
||||
|
||||
# Spin up a client and connect to mumble server
|
||||
mumble = pymumble.Mumble(server, nick, password=pwd, port=port)
|
||||
mumble = pymumble.Mumble(server, nick, password=pwd, port=port, tokens=tokens)
|
||||
|
||||
mumble.callbacks.set_callback(
|
||||
PYMUMBLE_CLBK_TEXTMESSAGERECEIVED, partial(message_received, mumble)
|
||||
|
|
Loading…
Reference in a new issue