GithubHelp home page GithubHelp logo

dyseo / asyncline Goto Github PK

View Code? Open in Web Editor NEW
35.0 8.0 22.0 610 KB

Unofficially Line bot Messaging using Asynchronous

License: MIT License

Python 100.00%
bot python3 linebot asynchronous mit-license asyncio botline line-messaging-api

asyncline's Introduction

AsyncLine
Line Messaging API for Python
PyPi Releases Community

Python License Build Version

Important

Please be warned: AsyncLine is in a very early beta. You will encounter bugs when using it. In addition, there are very many rough edges. With that said, please try it out in your applications: I need your feedback to fix the bugs and file down the rough edges.

Features

  • Fully Asynchronously
  • Slightly faster
  • Easy to use
  • Documented
  • Type-hint everywhere

Installation

  • pip3 install AsyncLine --upgrade

Simple usage

from AsyncLine import Client
import asyncio

cli = Client('ios')
cli.login(name='your session name', qr=True)

"""
Args login:
	name: string for create new session for next login, no effect if using token login
	token: string of token for login using token, no need to create session name
	mail: string of email that using for login using email, you can pass name session for custom session
			default using string of email for name session
	passwd: password of email used
	cert: (string | optional) if you have cert pass at this args for easy login using email
			sure you can use custom session name for this too
	qr: boolean pass True if want to login using authQr, and you can use custom session name
		e.g client.login(name="sync", qr=True) this needed for next login
"""

@cli.hooks(type=25, filters=Filters.command("hello"))
async def hello_message(client, msg):
	await client.talk.sendMessage(msg.to, "Heyy!")
	
#Run bot
cli.poll.streams()

Please read Example for more detail about usage this lib

Author

Dyseo / @Dyseo

Base Source

Asynz / Anysz

Getting Error

Issues always open for this

License

AsyncLine - Unofficially API Client library for Python

A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.

AsyncLine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

asyncline's People

Contributors

alnyz 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asyncline's Issues

Ga work

Bang, kok ga bisa ya? udh ngikutin example tpi ga respon

info

The storage in db was a good idea why did you remove it?
And don't you get banned for using the old timeline id in your config? i got banned when i was using the linepy with that id like a year or 2 ago....?

Potential dependency conflicts between asyncline and requests

Hi, as shown in the following full dependency graph of asyncline, asyncline requires requests * , while the installed version of frugal(3.4.1) requires requests <3,>=2.12.5.

According to Pip's “first found wins” installation strategy, requests 2.22.0 is the actually installed version.

Although the first found package version requests 2.22.0 just satisfies the later dependency constraint (requests <3,>=2.12.5), it will lead to a build failure once developers release a newer version of requests.

Dependency tree--------

asyncline - 1.5.9.5
| +- aiohttp(install version:3.6.2 version range:*)
| +- aiostomp(install version:1.6.2 version range:*)
| | +- async-timeout(install version:4.0.0a2 version range:*)
| | | +- typing-extensions(install version:3.7.4 version range:>=3.6.5)
| | +- bumpversion(install version:0.5.3 version range:*)
| | +- six(install version:1.13.0 version range:*)
| +- async-timeout(install version:4.0.0a2 version range:*)
| | +- typing-extensions(install version:3.7.4 version range:>=3.6.5)
| +- asyncio-nats-client(install version:0.10.0 version range:*)
| +- frugal(install version:3.4.1 version range:*)
| | +- requests(install version:2.22.0 version range:<3,>=2.12.5)
| | | +- certifi(install version:2019.9.11 version range:>=2017.4.17)
| | | +- chardet(install version:3.0.4 version range:<3.1.0,>=3.0.2)
| | | +- idna(install version:2.8 version range:>=2.5,<2.9)
| | | +- urllib3(install version:1.25.7 version range:<1.26,>=1.21.1)
| | +- six(install version:1.13.0 version range:>=1.10.0,<2)
| | +- thrift(install version:0.10.0 version range:==0.10.0)
| | | +- six(install version:1.13.0 version range:>=1.7.2)
| +- requests(install version:2.22.0 version range:*)
| | +- certifi(install version:2019.9.11 version range:>=2017.4.17)
| | +- chardet(install version:3.0.4 version range:<3.1.0,>=3.0.2)
| | +- idna(install version:2.8 version range:>=2.5,<2.9)
| | +- urllib3(install version:1.25.7 version range:<1.26,>=1.21.1)
| +- rsa(install version:4.0 version range:*)
| | +- pyasn1(install version:0.4.8 version range:>=0.1.3)
| +- ujson(install version:1.35 version range:*)
| +- pymongo(install version:3.10.0 version range:*) 

Thanks for your attention.
Best,
Neolith

AttributeError: 'Message' object has no attribute '_from'

I found this, I dont know if its a bug or not.

Traceback (most recent call last):
File "C:\Users\Fakhr\Programs\python\asyncline\LineSync\poll.py", line 84, in streams
await self.execute(k, op.message)
File "C:\Users\Fakhr\Programs\python\asyncline\LineSync\poll.py", line 61, in execute
await coro(*args)
File "tracer.py", line 36, in send_message
name = (await cl.getContacts(msg._from)).displayName
AttributeError: 'Message' object has no attribute '_from'

'blocked user' when trying to login

  File "/Users/xxxx/Documents/gits/AsyncLine/examples/echo.py", line 5, in <module>
    cl.login(name='test', qr=True)
  File "/Users/xxxx/Documents/gits/AsyncLine/AsyncLine/main.py", line 113, in login
    self.__validate(name, token, mail, passwd, cert, qr)
  File "/Users/xxxx/Documents/gits/AsyncLine/AsyncLine/main.py", line 59, in __validate
    f = SyncAsync(self.auth.createLoginSession(name, token, mail, passwd, cert, qr)).run()
  File "/Users/xxxx/Documents/gits/AsyncLine/AsyncLine/models.py", line 10, in run
    return self.loop(self._coroutine)
  File "/Users/xxxx/.pyenv/versions/3.8.1/lib/python3.8/asyncio/base_events.py", line 612, in run_until_complete
    return future.result()
  File "/Users/xxxx/Documents/gits/AsyncLine/AsyncLine/auth.py", line 95, in createLoginSession
    await self.loginWithQrcode(path=name+".session" if name else None)
  File "/Users/xxxx/Documents/gits/AsyncLine/AsyncLine/auth.py", line 129, in loginWithQrcode
    lr = await self.call('loginZ', rq)
  File "/Users/xxxx/Documents/gits/AsyncLine/AsyncLine/lib/Gen/f_LineService.py", line 26096, in loginZ
    return await self._methods['loginZ']([ctx, loginRequest])
  File "/Users/xxxx/Documents/gits/AsyncLine/AsyncLine/lib/Gen/f_LineService.py", line 26123, in _loginZ
    raise result.e
AsyncLine.lib.Gen.ttypes.TalkException: TalkException(code=35, reason='blocked user', parameterMap=None)

This happens however I tried to login (via QR or email/password) I can confirm it is correct because I received login verifications

It says I was logged in on an iPad the first time when I tried to login

kickoutFromGroup invalid contactsId

I found this when using operation type 19

Traceback (most recent call last):
  File "C:\Users\Fakhr\Programs\python\asyncline\LineSync\poll.py", line 87, in streams
    await self.execute(k, op)
  File "C:\Users\Fakhr\Programs\python\asyncline\LineSync\poll.py", line 62, in execute
    await coro(*args)
  File "bot.py", line 33, in notifed_kick
    await cl.talk.kickoutFromGroup(op.param1,op.param2)
  File "C:\Users\Fakhr\Programs\python\asyncline\LineSync\talk.py", line 547, in kickoutFromGroup
    return bool(await self.auth.call("kickoutFromGroup", 0, group_id, [mid]))
  File "C:\Users\Fakhr\Programs\python\asyncline\LineSync\lib\Gen\f_LineService.py", line 11374, in kickoutFromGroup
    return await self._methods['kickoutFromGroup']([ctx, reqSeq, groupId, contactIds])
  File "C:\Users\Fakhr\Programs\python\asyncline\LineSync\lib\Gen\f_LineService.py", line 11403, in _kickoutFromGroup
    raise result.e
LineSync.lib.Gen.ttypes.TalkException: TalkException(code=0, reason='invalid contactIds', parameterMap={})

is this a bug or not I don't know, but here my code
1564469966481

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.