shizmob / pydle

An IRCv3-compliant Python 3 IRC library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code example in README not works

SilverRainZ opened this issue · comments

In Basic Usage section, it seems that the pydle.Client does not have a run method?

$ python -V
Python 3.6.0

$ python -c 'import pydle; print(pydle.__version__)'
0.8.4

$ cat test.py
import pydle

# Simple echo bot.
class MyOwnBot(pydle.Client):
    async def on_connect(self):
         await self.join('#bottest')

    async def on_message(self, target, source, message):
         await self.message(target, message)

client = MyOwnBot('MyBot', realname='My Bot')
client.run('irc.rizon.net', tls=True, tls_verify=False)

$ python test.py
Traceback (most recent call last):
  File "test.py", line 12, in <module>
    client.run('irc.rizon.net', tls=True, tls_verify=False)
  File "/home/la/.pyenv/versions/venv/lib/python3.6/site-packages/pydle/client.py", line 430, in __getattr__
    raise AttributeError(attr)
AttributeError: run

Based on your error, you're using the tagged v0.8.4 release.
Client.run was added in the asyncio branch with db6cdfb.
It was then merged into the master branch after the v0.8.4 release with 801d9e8.
For basic usage with the v0.8.4 release, see https://github.com/Shizmob/pydle/tree/v0.8.4#basic-usage.
In the future, please make sure you're using the most recent development version when reporting issues.

Sorry, my fault.

Closed.