-
Notifications
You must be signed in to change notification settings - Fork 81
/
messages.py
33 lines (27 loc) · 901 Bytes
/
messages.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding: utf-8 -*-
from constants import *
from threading import Lock
class Cmd:
"""
Define a command object, used to ask an action from the pymumble thread,
usually to forward to the murmur server
"""
def __init__(self):
self.cmd_id = None
self.lock = Lock()
self.cmd = None
self.parameters = None
self.response = None
class MoveCmd(Cmd):
"""Command to move a user from channel"""
def __init__(self, session, channel_id):
Cmd.__init__(self)
self.cmd = PYMUMBLE_CMD_MOVE
self.parameters = {"session": session,
"channel_id": channel_id}
class ModUserState(Cmd):
"""Command to change a user state"""
def __init__(self, session, params):
Cmd.__init__(self)
self.cmd = PYMUMBLE_CMD_MODUSERSTATE
self.parameters = params