Coder Social home page Coder Social logo

znc-bot's Introduction

znc-bot

znc-bot depends on a recent development build of ZNC compiled with modpython.

Installation

To install znc-bot you can copy the source files onto your znc modules directory, which can usually be found at ~/.znc/modules or /usr/lib/znc/modules.

Loading

Loading znc-bot

/msg *status loadmod bot

Once the core bot has been loaded you can load any included plugins.

/msg *status loadmod security
/msg *status loadmod rand

Bot API

from bot.api import *

class helloworld(Module):
    @command
    def hi(self, event, args):
        return "Hello there!"

Asyncronous HTTP

from bot.api import *

class trakt(Module):
    @command
    @http
    def trending(self, event, string):
        event.http('http://api.trakt.tv/movies/trending.json/my-api-key')

    @trending.http(200)
    def handle_trending(self, event, response):
        for movie in movies.json:
            event.write('{title} ({year}) - {overview}'.format(**movie)) 

znc-bot's People

Contributors

kylef avatar apmorton avatar

Stargazers

Joseph Chiocchi avatar Tejas Sanap avatar  avatar Keith Swett avatar  avatar Gil Klein avatar Andrei Luca avatar  avatar Luke James avatar Chewy avatar Vinícius Abrahão Bazana Schmidt avatar Liam Mac Gillavry avatar Angus H. avatar Herb Tarlek avatar MAXiDEN avatar Matthias Sturm avatar  avatar Andrej Manduch avatar Yuya Tanaka avatar Max Albrecht avatar  avatar

Watchers

 avatar Vinícius Abrahão Bazana Schmidt avatar James Cloos avatar Herb Tarlek avatar  avatar

znc-bot's Issues

Periodic tasks

@interval(10) # run every 10 seconds
@http
def do_something(event, *args):
    event.http('http://some-url.com/my-thing')

@do_something.http(200)
def handle_something(event, response):
    pass

the http bit is just one possible use case, but i can see timers being handy in these bots.

and lets face it, the timer api in python is rather 'bleh' compared to a decorator like this.

Installation problems

Hey
I Copied the znc-bot folder to the ~/znc*/modules/ folder just as you said, but i get this error message when i am trying to load the module "Unable to find modinfo [bot] [Unable to find module [bot]]".
what should i do?

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.