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("--channel", help="Set channel", default="")
|
||||||
parser.add_argument("--name", help="Set bot nickname", default="RadioRobbot")
|
parser.add_argument("--name", help="Set bot nickname", default="RadioRobbot")
|
||||||
parser.add_argument("--server", help="Set server", default="mumble.esiliati.org")
|
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("--port", help="Set port", type=int, default=64738)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--stream",
|
"--stream",
|
||||||
|
@ -48,6 +49,11 @@ def get_parser():
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--max-silence-time", type=int, help="max silence time in seconds", default=30
|
"--max-silence-time", type=int, help="max silence time in seconds", default=30
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--tokens",
|
||||||
|
help="Set tokens list",
|
||||||
|
nargs="*"
|
||||||
|
)
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,16 +63,17 @@ def main():
|
||||||
args = get_parser().parse_args()
|
args = get_parser().parse_args()
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|
||||||
pwd = "" # password
|
pwd = args.password
|
||||||
server = args.server
|
server = args.server
|
||||||
nick = args.name
|
nick = args.name
|
||||||
channel = args.channel
|
channel = args.channel
|
||||||
port = args.port
|
port = args.port
|
||||||
|
tokens = args.tokens
|
||||||
is_streaming = False
|
is_streaming = False
|
||||||
stream_always = args.stream
|
stream_always = args.stream
|
||||||
|
|
||||||
# Spin up a client and connect to mumble server
|
# 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(
|
mumble.callbacks.set_callback(
|
||||||
PYMUMBLE_CLBK_TEXTMESSAGERECEIVED, partial(message_received, mumble)
|
PYMUMBLE_CLBK_TEXTMESSAGERECEIVED, partial(message_received, mumble)
|
||||||
|
|
Loading…
Reference in a new issue