More cleanup, merged pymumble into the project so I don't have to maintain 2 separate things, tested working version.
This commit is contained in:
42
pymumble_py3/blobs.py
Normal file
42
pymumble_py3/blobs.py
Normal file
@@ -0,0 +1,42 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import struct
|
||||
|
||||
from .constants import *
|
||||
from .mumble_pb2 import RequestBlob
|
||||
|
||||
|
||||
class Blobs(dict):
|
||||
"""
|
||||
Manage the Blob library
|
||||
"""
|
||||
def __init__(self, mumble_object):
|
||||
self.mumble_object = mumble_object
|
||||
|
||||
def get_user_comment(self, hash):
|
||||
"""Request the comment of a user"""
|
||||
if hash in self:
|
||||
return
|
||||
request = RequestBlob()
|
||||
request.session_comment.extend(struct.unpack("!5I", hash))
|
||||
|
||||
self.mumble_object.send_message(PYMUMBLE_MSG_TYPES_REQUESTBLOB, request)
|
||||
|
||||
def get_user_texture(self, hash):
|
||||
"""Request the image of a user"""
|
||||
if hash in self:
|
||||
return
|
||||
|
||||
request = RequestBlob()
|
||||
request.session_texture.extend(struct.unpack("!5I", hash))
|
||||
|
||||
self.mumble_object.send_message(PYMUMBLE_MSG_TYPES_REQUESTBLOB, request)
|
||||
|
||||
def get_channel_description(self, hash):
|
||||
"""Request the description/comment of a channel"""
|
||||
if hash in self:
|
||||
return
|
||||
|
||||
request = RequestBlob()
|
||||
request.channel_description.extend(struct.unpack("!5I", hash))
|
||||
|
||||
self.mumble_object.send_message(PYMUMBLE_MSG_TYPES_REQUESTBLOB, request)
|
Reference in New Issue
Block a user