Skip to main content

uranuspy is the python SDK in Tianmu client

Project description

F.R.I.D.A.Y

the next generation artificial intelligence bot after Jarvis. in this vision, some improvements were made:

  • More robust;
  • Connect to uranus;
  • Mission support, I can add missions to Friday;
  • Learnable, Friday supports learning new things with mental;
  • More..

Friday based on uranuspy.

You can register a robot account on http://g.manaai.cn, then you can use the bot user name and password to connect uranuspy:

from uranuspy.im.models import ChatMessage, ContactChat, User
from uranuspy.im.client import ChatClient


client = ChatClient("bot", "xxx")


def hanlde_txt_msg(
    msg: ChatMessage, contact: ContactChat, myself: User, client: ChatClient
):
    """
    Main logic to process the received message
    """
    print(f"Received chat message: {msg} {myself}")
    talk_to = msg.fromId
    from_talk = msg.text

    print(myself.user_nick_name, from_talk, msg.text)
    if from_talk != None:
        if contact.isGroup:
            if f"@{myself.user_nick_name}" in from_talk:
                return "我在呢~", myself
        else:
            return "测试消息,这是echo测试", myself


@client.on_txt_msg
def on_txt_msg(
    msg: ChatMessage, contact: ContactChat, myself: User, client: ChatClient
):
    return hanlde_txt_msg(msg, contact, myself, client)


if __name__ == "__main__":
    client.run_forever()

Updates

  • 2021.11.14: Add new Siren client support, it now can be connected with Siren client;

Requirements

For ubuntu setup simply:

pip install -r requirements.txt

If on windows, for some package might not easy to install, like PyAduio, it can be installed via pipwin:

pip install pipwin
pipwin install pyaudio

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uranuspy-0.0.3.tar.gz (32.1 kB view details)

Uploaded Source

File details

Details for the file uranuspy-0.0.3.tar.gz.

File metadata

  • Download URL: uranuspy-0.0.3.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for uranuspy-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ef57e6ca90a2a58ef2f1dc28e34b9d099cfe026abe330fb25d360fcd0b05a3b4
MD5 66f57e1071ed452b24b37acb5b1c1087
BLAKE2b-256 e6796da1870fc7498c0faa8b8043e360836ea0d8b542cf5b09aeb4ee9acfd51c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page