bugfixing
This commit is contained in:
@@ -472,7 +472,8 @@ class XMPPTelegram(ComponentXMPP):
|
||||
time.sleep(1)
|
||||
self.tg_process_dialogs(jid)
|
||||
|
||||
def group(self): #2 args
|
||||
def group(hndl, self): #2 args
|
||||
"""Creat a Group"""
|
||||
hndl._min_args(2)
|
||||
# group name? #
|
||||
groupname = parsed[1]
|
||||
@@ -484,19 +485,18 @@ class XMPPTelegram(ComponentXMPP):
|
||||
self.tg_connections[jid].invoke(CreateChatRequest([groupuser], groupname))
|
||||
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)
|
||||
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"""
|
||||
hndl._min_args(1)
|
||||
|
||||
@@ -585,7 +585,9 @@ class XMPPTelegram(ComponentXMPP):
|
||||
reply = str(handler(self))
|
||||
except Exception as e:
|
||||
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:
|
||||
if isinstance(e, NotAuthorizedError):
|
||||
reply = str(e)
|
||||
|
||||
Reference in New Issue
Block a user