bugfixing

This commit is contained in:
2019-02-27 00:29:04 +01:00
parent 9d2ff0caaa
commit 4f07b24c6d

View File

@@ -472,7 +472,8 @@ class XMPPTelegram(ComponentXMPP):
time.sleep(1) time.sleep(1)
self.tg_process_dialogs(jid) self.tg_process_dialogs(jid)
def group(self): #2 args def group(hndl, self): #2 args
"""Creat a Group"""
hndl._min_args(2) hndl._min_args(2)
# group name? # # group name? #
groupname = parsed[1] groupname = parsed[1]
@@ -484,19 +485,18 @@ class XMPPTelegram(ComponentXMPP):
self.tg_connections[jid].invoke(CreateChatRequest([groupuser], groupname)) self.tg_connections[jid].invoke(CreateChatRequest([groupuser], groupname))
self.tg_process_dialogs(jid) self.tg_process_dialogs(jid)
def channel(self): #1 arg
hndl._min_args(1)
groupname = parsed[1]
self.tg_connections[jid].invoke(CreateChannelRequest(groupname, groupname, broadcast = True))
self.tg_process_dialogs(jid)
def supergroup(self): #1 arg def supergroup(hndl, self): #1 arg
"""Create a channel"""
hndl._min_args(1) hndl._min_args(1)
groupname = parsed[1]
self.tg_connections[jid].invoke(CreateChannelRequest(groupname, groupname, megagroup = True))
self.tg_process_dialogs(jid)
def username(self): #1 arg groupname = hndl.arguments[0]
self.tg_connections[hndl.jid].invoke(CreateChannelRequest(groupname, groupname, megagroup = True))
self.tg_process_dialogs(hndl.jid)
channel = supergroup
def username(hndl, self): #1 arg
"""Change your Telegram nickname""" """Change your Telegram nickname"""
hndl._min_args(1) hndl._min_args(1)
@@ -585,7 +585,9 @@ class XMPPTelegram(ComponentXMPP):
reply = str(handler(self)) reply = str(handler(self))
except Exception as e: except Exception as e:
if self.config["debug"]: if self.config["debug"]:
reply = traceback.format_exc() reply = "******* DEBUG MODE ACTIVE *********\n"
reply += "An Exception occured while executing this command:"
reply += traceback.format_exc()
else: else:
if isinstance(e, NotAuthorizedError): if isinstance(e, NotAuthorizedError):
reply = str(e) reply = str(e)