-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from DuckBoss/new-callback-system
New callback system
- Loading branch information
Showing
11 changed files
with
182 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from JJMumbleBot.settings import global_settings | ||
from pymumble_py3.constants import PYMUMBLE_CLBK_USERCREATED, PYMUMBLE_CLBK_CONNECTED, PYMUMBLE_CLBK_SOUNDRECEIVED, \ | ||
PYMUMBLE_CLBK_TEXTMESSAGERECEIVED, PYMUMBLE_CLBK_DISCONNECTED, PYMUMBLE_CLBK_CHANNELUPDATED, \ | ||
PYMUMBLE_CLBK_CHANNELREMOVED, PYMUMBLE_CLBK_CHANNELCREATED, PYMUMBLE_CLBK_USERREMOVED, PYMUMBLE_CLBK_USERUPDATED | ||
|
||
|
||
class CallbackService: | ||
def __init__(self): | ||
pass | ||
|
||
@staticmethod | ||
def message_received(text, remote_cmd=False): | ||
global_settings.core_callbacks.callback(PYMUMBLE_CLBK_TEXTMESSAGERECEIVED, text, remote_cmd) | ||
|
||
@staticmethod | ||
def sound_received(user, audiochunk): | ||
global_settings.core_callbacks.callback(PYMUMBLE_CLBK_SOUNDRECEIVED, user, audiochunk) | ||
|
||
@staticmethod | ||
def connected(): | ||
global_settings.core_callbacks.callback(PYMUMBLE_CLBK_CONNECTED) | ||
|
||
@staticmethod | ||
def disconnected(): | ||
global_settings.core_callbacks.callback(PYMUMBLE_CLBK_DISCONNECTED) | ||
|
||
@staticmethod | ||
def channel_created(channel): | ||
global_settings.core_callbacks.callback(PYMUMBLE_CLBK_CHANNELCREATED, channel) | ||
|
||
@staticmethod | ||
def channel_updated(channel, modified_params): | ||
global_settings.core_callbacks.callback(PYMUMBLE_CLBK_CHANNELUPDATED, channel, modified_params) | ||
|
||
@staticmethod | ||
def channel_removed(channel): | ||
global_settings.core_callbacks.callback(PYMUMBLE_CLBK_CHANNELREMOVED, channel) | ||
|
||
@staticmethod | ||
def user_created(user): | ||
global_settings.core_callbacks.callback(PYMUMBLE_CLBK_USERCREATED, user) | ||
|
||
@staticmethod | ||
def user_updated(user, modified_params): | ||
global_settings.core_callbacks.callback(PYMUMBLE_CLBK_USERUPDATED, user, modified_params) | ||
|
||
@staticmethod | ||
def user_removed(user, message): | ||
global_settings.core_callbacks.callback(PYMUMBLE_CLBK_USERREMOVED, user, message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters