GithubHelp home page GithubHelp logo

gigathonapi's Introduction

Hi there, I'm AleksFolt

GigaChat Messenger Api

This is not the official library for the gigachat.ru messenger. We are not responsible for this project for all your actions you are responsible if you use this library

Authentication

  1. Go to gigachat.ru
  2. Register or log in to your existing account
  3. Open developer console: F12 or Ctrl + Shift + C
  4. Application → Cookies → https://gigachat.ru → Copy the value of PHPSESSID cookie.

Install

$ pip install gigathon-api==0.0.1

Usage

Import:

from gigachat-api import GigaChat
import asyncio

api_token = "your_token"

client = GigaChat(api_token, "leave it like that")

Usage:

async def main():
  last = None
  while True:
      messages = await client.get_messages(last=last)
      for message in messages:
          last = message
          if message[1] != last:
              if not message[1]:
                  continue
              prompt = message[1][1]
              if prompt == "":
                  continue
              response = prompt
              await client.send_message(response, message[0])

and:

if __name__ == "__main__":
    asyncio.run(main())

Authors

Created a library and did all the routine: Alekami649

Deployed to pypi, made a repository on github and came up with an idea (or maybe not): AleksFolt

PyPi: https://pypi.org/project/gigathon-api/0.0.1/

gigathonapi's People

Contributors

aleksfolt avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.