Skip to main content

A simple API for IRC networks

Project description

prestige_irc

This module is a simple API for IRC networks.

Installation

pip

pip install prestige_irc

or

python -m pip install prestige_irc

Manually

Clone this repository into your repo, and install setup.py:

git clone https://github.com/avahe-kellenberger/prestige_irc.git
cd prestige_irc
python setup.py install

You should now be able to import modules, e.g. from prestige_irc.commands import Commands

API Usage

Creating a connection

Initialize a connection to an IRC network by creating a new IRCConnection, and invoking the connect function.

irc_connection = IRCConnection("YourBotsNick")
irc_connection.connect(ip_address="irc.freenode.net")

Listeners:

Add message listeners to the IRCConnection object.

def receive(msg):
    if msg.command == Commands.PRIVMSG:
        print(msg.text)

listener = MessageListener(message_filter=lambda msg: True, receive=receive)
irc_connection.add_listener(listener)

Attach a listener for server messages, and add filters for said message objects. Filters are invoked by irc.MessageListener#accept, which is automatically called when an IRCConnection receieves a message. When this method returns true, irc.MessageListener#receive is invoked.

See the code documentation for details.

Sending Messages:

Most commands are supported by the API by default, and are placed in IRCConnection. Commands are prefixed with cmd_, such as cmd_privmsg, cmd_join, and cmd_kick.

These preset commands will handle the message formatting that the IRC server requires, with documentation reflecting the RFC. Commands that are not yet supported by default can be sent manually with IRCConnection.send_command and/or IRCConnection.send.

Speculative Updates:

In the future, this module may support every RFC specified IRC command, if it becomes widely requested.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prestige_irc-0.0.1.post2.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prestige_irc-0.0.1.post2-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file prestige_irc-0.0.1.post2.tar.gz.

File metadata

  • Download URL: prestige_irc-0.0.1.post2.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for prestige_irc-0.0.1.post2.tar.gz
Algorithm Hash digest
SHA256 f36915301d43ba43a3d28b9ecf6f0e5ba09088ceb875c5a60af9ea956300e122
MD5 97fceb21b3386d44f695e41f0eec193c
BLAKE2b-256 24c3c52a1eef60b04a733798f532d5358c032964d2dd0b3fdd3bfd29e5786b6a

See more details on using hashes here.

File details

Details for the file prestige_irc-0.0.1.post2-py3-none-any.whl.

File metadata

  • Download URL: prestige_irc-0.0.1.post2-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for prestige_irc-0.0.1.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 9984994f97944780eb3584b9b0128bcaa388d0d4e7824e4f76859142fc915b9b
MD5 3f7f867760c1ef6e340382cdce11f257
BLAKE2b-256 e645fc6a298f166662a4541162d1c6e81feffed17c2fef55b612f3efa630c275

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page