Giter Club home page Giter Club logo

pyquassel's Introduction

PyQuassel

Pure python 3 implementation of QuasselClient. Doesn't depend on any PySide/PyQt libraries.

Based on:

Setup

Install

git clone https://github.com/Zren/PyQuassel.git
cd PyQuassel

Create config.py

host = 'localhost'
port = 4242
username = 'AdminUser'
password = 'PASSWORD'

Run

python quasselbot.py

Update

git pull origin master

Plugins

Enable a plugin by adding it's name in config.py.

enabledPlugins = [
    'chatlog',
    'pushbullet',
]

chatlog

Prints chat messages to the console.

pushbullet

Recieve push notifications for specific keywords or from query buffers. Current nick/highlight support not yet available.

config.py

"""
For push notifications, you'll need an Access Token which
can gotten from your account settings.
https://www.pushbullet.com/#settings/account
"""
pushbulletAccessToken = 'asd78f69sd876f765dsf78s5da7f5as7df8a58s7dfADS'
"""
To push to all decives, push set as None.
To push to a specific device, enter the device name.
https://www.pushbullet.com/#settings/devices 
"""
pushbulletDeviceName = None
# pushbulletDeviceName = 'Motorola XT1034'

pushIfKeyword = [ # Case Insensitive
    'Zren',
    'Shadeness',
    'Pushbullet',
]

webapp

A very simple webserver to glance at recent messages. When enabled, the bot uses a total ~30 Mb of RAM.

config.py

"""
Webapp to read the last 50 messages in all channels.
The pushbullet plugin will send links to the webapp if enabled.
"""
webappPort = 3000
webappServerName = 'localhost'

# The session key is used instead of username/password to view the webapp.
# If left blank, a new key is generated each run.
# Generate a good key with: python -c "import os; print(os.urandom(24))"
# webappSessionKey = ''
webappSessionKey =  b'hN\xe7\xfd\x95[\xc0\xdfH\x96\xe4W\xaf\xad\xe2\x12#\xcfu\x92\x1eZ<\xf9'

pyquassel's People

Contributors

ecmaxp avatar zren 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

Watchers

 avatar  avatar  avatar  avatar

pyquassel's Issues

OSError: Device Closed

I get the following Traceback when I try to start PyQuassel:

Plugin "plugins/pushbullet.py" loaded.
Traceback (most recent call last):
   File "./quasselbot.py", line 74, in <module>
     quasselClient.run()
   File "PyQuassel/quasselclient.py", line 269, in run
     self.createSession()
   File "PyQuassel/quasselclient.py", line 260, in createSession
     self.readClientLogin()
   File "PyQuassel/quasselclient.py", line 110, in readClientLogin
     data = self.stream.read()
   File "PyQuassel/qt.py", line 311, in read
     raise IOError('Device Closed')
 OSError: Device Closed

Any idea what could cause this? I'm running core 0.12.4 (90183ee)

"Buf" QUserType...?

allejo on IRC had this traceback.

Traceback (most recent call last):
  File "quasselbot.py", line 74, in <module>
    quasselClient.run()
  File "/home/allejo/PyQuassel/quasselclient.py", line 269, in run
    self.createSession()
  File "/home/allejo/PyQuassel/quasselclient.py", line 262, in createSession
    self.readSessionState()
  File "/home/allejo/PyQuassel/quasselclient.py", line 114, in readSessionState
    data = self.stream.read()
  File "/home/allejo/PyQuassel/qt.py", line 315, in read
    obj = self.readQVariant()
  File "/home/allejo/PyQuassel/qt.py", line 337, in readQVariant
    val = self.readQMap()
  File "/home/allejo/PyQuassel/qt.py", line 388, in readQMap
    value = self.readQVariant()
  File "/home/allejo/PyQuassel/qt.py", line 337, in readQVariant
    val = self.readQMap()
  File "/home/allejo/PyQuassel/qt.py", line 388, in readQMap
    value = self.readQVariant()
  File "/home/allejo/PyQuassel/qt.py", line 350, in readQVariant
    val = self.readQList()
  File "/home/allejo/PyQuassel/qt.py", line 468, in readQList
    val = self.readQVariant()
  File "/home/allejo/PyQuassel/qt.py", line 370, in readQVariant
    raise Exception("QUserType.name", name)
Exception: ('QUserType.name', 'Buf')

400 errors

With my config I'm always getting 400 errors possibly something to do with device handling.

Python version

You may want to mention which python version required in the docs.

oAuth v2

If you used oAuth 2 the pushes from pyquassel can be grouped into a single channel

TODO

QDataStream

  • QDateTime deserialization / serialization
  • QTime deserialization / serialization
  • Message.flags deserialization

LibQuassel

  • Connection
    • SSL (Meh, should be run on same host)
    • Encryption (Meh, should be run on same host)
  • HeartBeat

PushBullet

  • Lighter weight python library using urllib.
  • Current nick highlight (must currently manually specify a token to highlight which ignore's nicks with a _ suffix when the target nick is taken).
  • Don't spam messages
    • It currently it delete's the old push and sends a new one with the previous messages. Chrome on windows does not hide the old notification however, so I probably need to dismiss it first, then delete it.
  • Link to WebApp

WebApp

  • sendInput
  • Decent UI
  • Serialize a generated flask session SECRET_KEY and a user api key.
  • Login form (rather than just an api key parameter => session variable linked with the pushbullet plugin).

Typo in onMessageRecieved

Just saw this in a user's script: onMessageRecieved is misspelled, it should read onMessageReceived, "ie" -> "ei".

Telegram Plugin

Have you ever considered adding support for a telegram plugin?

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.