Giter Site home page Giter Site logo

krypton-byte / neonize Goto Github PK

View Code? Open in Web Editor NEW
48.0 1.0 11.0 2.17 MB

whatsapp automation library, written in python

Home Page: http://krypton-byte.me/neonize/

License: Apache License 2.0

Python 91.37% Shell 0.06% Go 8.36% C 0.15% Batchfile 0.06%
automation websockets whatsapp python whatsapp-automation whatsapp-api whatsapp-bot whatsapp-python pywhatkit

neonize's Introduction

Neonize

Release

Neonize is a Python library designed to streamline the automation of tasks on WhatsApp. With neonize, users can easily automate various actions on WhatsApp, such as sending messages, processing received messages, and executing specific actions based on predefined scenarios.

Key Features:

  1. Message Automation: Neonize provides a straightforward interface for sending automated messages to specific WhatsApp numbers.
  2. Message Processing: Users can define functions or actions to be taken based on received messages. This allows users to create automated responses or run specific scenarios based on message content.
  3. Binding with Whatsmeow: Neonize is built as a binding for the Whatsmeow library, leveraging similar functionality. This provides more flexibility in development and integration with functions that users may already be familiar with from Whatsmeow.
  4. Communication with Protobuf: Neonize uses the Protobuf format as the communication protocol, offering speed and efficiency in data exchange between the application and WhatsApp.

Usage:

  1. Simple Installation: Neonize can be easily installed through Python package managers such as pip.
    pip install neonize
  2. Initialization and Configuration: Users can quickly configure neonize to use the desired WhatsApp account.
  3. Easy-to-Use: Neonize provides a simple API and clear documentation to facilitate usage. Users can swiftly write scripts for WhatsApp automation according to their needs.

With neonize as a binding for Whatsmeow, WhatsApp automation becomes more accessible for Python developers, combining the strengths of both libraries and leveraging familiar functionalities from Whatsmeow.

To easily create a bot with minimal setup, you can utilize the Thundra library

Contribution Guidelines

If you would like to contribute to this project, please follow these steps:

  1. Fork this repository.
  2. Create a new branch: git checkout -b branch-name.
  3. Perform the desired tasks or changes.
  4. Commit the changes: git commit -m 'Commit message'.
  5. Push to branch: git push origin nama-branch.
  6. Send pull request.

Local Development

If you want to run this project locally, follow these steps:

  1. Clone the repository: git clone [email protected]:krypton-byte/neonize.git.
  2. Install dependencies: poetry install --with dev (customize to the project).
  3. Run the project: python examples/basic.py (customize to the project).

Lisensi

This project is licensed under Apache-2.0. See the LICENSE file for more information.


neonize's People

Contributors

krypton-byte avatar mhankbarbar avatar victor-abz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

neonize's Issues

Can't send .png file

Log:

File "/usr/local/lib/python3.11/dist-packages/neonize/client.py", line 848, in build_image_message
    img.save(thumbnail, format="jpeg")
  File "/usr/local/lib/python3.11/dist-packages/PIL/Image.py", line 2459, in save
    save_handler(self, fp, filename)
  File "/usr/local/lib/python3.11/dist-packages/PIL/JpegImagePlugin.py", line 653, in _save
    raise OSError(msg) from e
OSError: cannot write mode RGBA as JPEG

client.reply_message error

I encountered an error while testing basic.py from examples.

Screenshot of the error (cant copy from my terminal):
Picsart_24-02-11_15-45-16-973

freezed until I press Ctrl-c + funding question

image
After I successfully logged in, the program is blocked until I press Ctrl-c.
here is the minimal code to reproduce it

from neonize import NewClient
from neonize.utils.jid import build_jid

client = NewClient("test")
client.connect()
for i in range(50, 100, 2):
    import time
    client.send_message(build_jid("myPhoneNumber"), f"{i}")
    time.sleep(5)

Is there a way to avoid pressing Ctrl-c?

Another question:
Is it possible to avoid creating the sqlite3 db?

Another question:
where can we fund you? ;)

failed to find libmagic

from neonize.client import NewClient
ImportError: failed to find libmagic. Check your installation

How to setup on Mac "Darwin"

I am trying to setup on mac for the example.py. However I get error neonize.download.UnsupportedPlatform: neonize-darwin-arm64.so

How would one be able to execute the project on Darwin platform?

OSError: GLIBC_2.33 not found

I encountered an error while running the application. It seems to be related to a missing version of GLIBC (GNU C Library). Below is the traceback of the error:

Traceback (most recent call last):
  File "/workspaces/WaBOT/main.py", line 2, in <module>
    from src import Runner
  File "/workspaces/WaBOT/src/__init__.py", line 1, in <module>
    from .bot import Runner
  File "/workspaces/WaBOT/src/bot.py", line 2, in <module>
    from neonize.client import NewClient
  File "/workspaces/WaBOT/.venv/lib/python3.10/site-packages/neonize/__init__.py", line 1, in <module>
    from .client import NewClient
  File "/workspaces/WaBOT/.venv/lib/python3.10/site-packages/neonize/client.py", line 20, in <module>
    from ._binder import gocode, func_string, func_callback_bytes, func
  File "/workspaces/WaBOT/.venv/lib/python3.10/site-packages/neonize/_binder.py", line 38, in <module>
    gocode = load_goneonize()
  File "/workspaces/WaBOT/.venv/lib/python3.10/site-packages/neonize/_binder.py", line 28, in load_goneonize
    raise e
  File "/workspaces/WaBOT/.venv/lib/python3.10/site-packages/neonize/_binder.py", line 21, in load_goneonize
    gocode = ctypes.CDLL(f"{root_dir}/{generated_name()}")
  File "/home/codespace/.python/current/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /workspaces/WaBOT/.venv/lib/python3.10/site-packages/neonize/neonize-linux-amd64.so)

Environment:
- Operating System: Ubuntu 20.04.6 LTS x86_64
- Python Version: 3.10

Can't send sticker with .webp extension

Logs:

app[worker.1]: Exception ignored on calling ctypes callback function: <bound method Event.execute of <neonize.events.Event object at 0x7fbe5f20f560>>
2024-05-28T21:04:06.840274+00:00 app[worker.1]: Traceback (most recent call last):
2024-05-28T21:04:06.840276+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/neonize/events.py", line 129, in execute
2024-05-28T21:04:06.840423+00:00 app[worker.1]:     self.list_func[code](binary, size)
2024-05-28T21:04:06.840456+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/neonize/events.py", line 149, in serialization
2024-05-28T21:04:06.840544+00:00 app[worker.1]:     f(self.client, event.FromString(ctypes.string_at(binary, size)))
2024-05-28T21:04:06.840574+00:00 app[worker.1]:   File "/app/main.py", line 39, in on_message
2024-05-28T21:04:06.840662+00:00 app[worker.1]:     message_handler(client, message)
2024-05-28T21:04:06.840686+00:00 app[worker.1]:   File "/app/src/modules/handler.py", line 51, in message_handler
2024-05-28T21:04:06.840744+00:00 app[worker.1]:     Func.tele_to_wa_sticker(client, msg)
2024-05-28T21:04:06.840768+00:00 app[worker.1]:   File "/app/src/modules/func.py", line 314, in tele_to_wa_sticker
2024-05-28T21:04:06.840892+00:00 app[worker.1]:     client.send_sticker(
2024-05-28T21:04:06.840902+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/neonize/client.py", line 733, in send_sticker
2024-05-28T21:04:06.841103+00:00 app[worker.1]:     self.build_sticker_message(file, quoted, name, packname),
2024-05-28T21:04:06.841328+00:00 app[worker.1]:     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-05-28T21:04:06.841337+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/neonize/client.py", line 683, in build_sticker_message
2024-05-28T21:04:06.841489+00:00 app[worker.1]:     img = Image.open(io_save)
2024-05-28T21:04:06.841597+00:00 app[worker.1]:           ^^^^^^^^^^^^^^^^^^^
2024-05-28T21:04:06.841619+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/PIL/Image.py", line 3339, in open
2024-05-28T21:04:06.842207+00:00 app[worker.1]:     raise UnidentifiedImageError(msg)
2024-05-28T21:04:06.842239+00:00 app[worker.1]: PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7fbe5f3ef1f0>

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.