mirror of
https://github.com/nikdoof/mumblepy.git
synced 2025-12-22 14:19:22 +00:00
Fix channel messages and add channel linking.
This commit is contained in:
@@ -36,15 +36,33 @@ class Channel(object):
|
||||
return self.__channel.position
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
Remove the channel from Mumble
|
||||
"""
|
||||
self.__server.remove_channel(self.__channel.id)
|
||||
return True
|
||||
|
||||
def update(self, **kwargs):
|
||||
"""
|
||||
Update a channel property on the Mumble server
|
||||
"""
|
||||
for key, value in kwargs.items():
|
||||
setattr(self.__channel, key, value)
|
||||
self.__server.set_channel_state(self.__channel)
|
||||
|
||||
def send_message(self, text, tree=False):
|
||||
self.__server.send_message(self.__channel.id, tree, text)
|
||||
"""
|
||||
Send a message to the channel
|
||||
"""
|
||||
return self.__server.send_channel_message(self.__channel.id, text, tree)
|
||||
|
||||
def link(self, channel):
|
||||
"""
|
||||
Link this channel to another channel
|
||||
"""
|
||||
current_links = self.__channel.links
|
||||
current_links.append(channel.id)
|
||||
self.update(links=current_links)
|
||||
|
||||
def serialize(self):
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user