BOSWatch 3
Python Script to receive and decode German BOS Information with rtl_fm and multimon-NG
 
Loading...
Searching...
No Matches
plugin.telegram.MQBot Class Reference

Public Member Functions

def __init__ (self, *args, is_queued_def=True, mqueue=None, **kwargs)
 
def __del__ (self)
 
def send_message (self, *args, **kwargs)
 

Protected Attributes

 _is_messages_queued_default
 
 _msg_queue
 

Detailed Description

A subclass of Bot which delegates send method handling to MQ

Constructor & Destructor Documentation

◆ __init__()

def plugin.telegram.MQBot.__init__ (   self,
args,
  is_queued_def = True,
  mqueue = None,
**  kwargs 
)
34 def __init__(self, *args, is_queued_def=True, mqueue=None, **kwargs):
35 super(MQBot, self).__init__(*args, **kwargs)
36 # below 2 attributes should be provided for decorator usage
37 self._is_messages_queued_default = is_queued_def
38 self._msg_queue = mqueue or mq.MessageQueue()
39

◆ __del__()

def plugin.telegram.MQBot.__del__ (   self)
40 def __del__(self):
41 try:
42 self._msg_queue.stop()
43 except:
44 pass
45

Member Function Documentation

◆ send_message()

def plugin.telegram.MQBot.send_message (   self,
args,
**  kwargs 
)
Wrapped method would accept new `queued` and `isgroup`
OPTIONAL arguments
47 def send_message(self, *args, **kwargs):
48 '''Wrapped method would accept new `queued` and `isgroup`
49 OPTIONAL arguments'''
50 return super(MQBot, self).send_message(*args, **kwargs)
51
52

Field Documentation

◆ _is_messages_queued_default

plugin.telegram.MQBot._is_messages_queued_default
protected

◆ _msg_queue

plugin.telegram.MQBot._msg_queue
protected