コード例 #1
0
ファイル: id.py プロジェクト: kanhan258/phbot
def run(msg, matches):
    receiver = utils.get_receiver(msg)
    print()
    if len(matches) == 1:
        if matches[0] == "!id":
            return user_id(msg)
        elif matches[0] == 'chat':
            if not utils.is_chat_msg(msg):
                return 'You are not in a chat'
            else:
                receiver.info(callback)
    elif len(matches) == 2:
        return "Not implemented yet the function necesary in tgl :'('"
    # Implement your run function here
    return ""
コード例 #2
0
ファイル: id.py プロジェクト: Iran-Python/pybotgram
def run(msg, matches):
    receiver = utils.get_receiver(msg)
    print()
    if len(matches) == 1:
        if matches[0] == "!id":
            return user_id(msg)
        elif matches[0] == 'chat':
            if not utils.is_chat_msg(msg):
                return 'You are not in a chat'
            else:
                receiver.info(callback)
    elif len(matches) == 2:
        return "Not implemented yet the function necesary in tgl :'('"
    # Implement your run function here
    return ""
コード例 #3
0
ファイル: id.py プロジェクト: kanhan258/phbot
def user_id(msg):
    text = "{} (user#id{})".format(msg.src.name, msg.src.id)
    if utils.is_chat_msg(msg):
        text = "{}\nYou are in group {} (chat#id{})".format(
            text, msg.dest.name, msg.dest.id)
    return text
コード例 #4
0
ファイル: id.py プロジェクト: Iran-Python/pybotgram
def user_id(msg):
    text = "{} (user#id{})".format(msg.src.name, msg.src.id)
    if utils.is_chat_msg(msg):
        text = "{}\nYou are in group {} (chat#id{})".format(text, msg.dest.name, msg.dest.id)
    return text