GithubHelp home page GithubHelp logo

euphoria-py's Introduction

euphoria-py v0.7

Build Status

An asyncio based euphoria.io bot library and framework for Python 3.5 and newer, ONLY. Make sure you are using the right version of pip and the python interpreter.

API is expected to undergo major additions currently, and the documentation isn't all there yet.

Documentation

Installation

To install the dependencies needed to run euphoria-py, install everything in requirements.txt

pip install -r requirements.txt

Extras

If using the euphoria.services.reddit_notify service, you must install The Pythonic Reddit API Wrapper (PRAW) as well.

pip install praw

Configuration

Edit bot.yml

bot:
  room: room-on-euphoria.io
  # The passcode option can be deleted for a public room
  passcode: password-to-private-room
  nick: bot-nickname
  services:
    # Gives you access to commands like !ping @botname, !kill @botname and !uptime @botname
    botrulez: euphoria.services.botrulez
    # Lets the bot send you reminders later, like !remind 15m take out the trash
    reminder: euphoria.services.reminder
    # Some services might take an extended set of options like reddit_notify
    reddit_notify:
      module: euphoria.services.reddit_notify
      reddit_agent: euphoria-py utility that notifies about new reddit posts
      # A list of subreddits to look for new posts in
      subreddits: [pics, programming, funny]
      # If threading is true then each new post goes in a thread specific to a particular subreddit instead of top-level
      threading: True
      # Customize the message the bot makes when there's a new post. Not all post elements used below have to be used
      post_format: "{short_link} New post to {subreddit} by {author}: {title}"
      # How many hours until a new per-subreddit thread is created
      hours_per_thread: 12

The bog logs information to the console and to a rotating log file by default, you can edit the configuration in logging.yml (It uses the standard python logging framework, see the official documentation)

Running

From this directory run:

python -m euphoria.bot

euphoria-py's People

Contributors

rainbowbismuth avatar

Stargazers

underscores avatar Cammie King avatar

Watchers

James Cloos avatar  avatar Cammie King avatar

euphoria-py's Issues

Bot sometimes doesn't try to auth or set nick.

The issue seems to be that since I start both the Client and the NickAndAuth state machine at the same time, sometimes NickAndAuth doesn't start before the Client, and will never see the HelloEvent or BounceEvent.

Fix is to rethink initialization of these two components.

reddit_notify should stick replies in a collapsable stack w/o human intervention

[cammiebutt] this isn't trivial, but
[cammiebutt] have the option to put all new posts without human messages in between under one root level message
[cammiebutt] so that someone can collapse all of them and have human stuffs closer together instead of a page of bot stuff during the night
[♐] i don't think that would be too hard
[♐] but that totally makes sense
[♐] also your feature request wouldn't work with maimai around >_>
[cammiebutt] why?
[♐] becayse maimai comments on every message
[cammiebutt] mhm
[cammiebutt] so ignore direct replies
[cammiebutt] I don't mind being able to collapse something if all we've talked about is the rattie things
[cammiebutt] or ignore bots
[cammiebutt] their user ID is sent iirc
[cammiebutt] yeah
[cammiebutt] look for "bot:" at the beginning of packet["data"]["sender"]["id"]
[♐] ohhh really? ok

Rewrite examples

There should be examples for using the euphoria.Client class by itself, rather then the full framework. They should be written well and automatically tested.

Bot should take a config for multiple rooms from one file

A user should be able to run a bot in multiple rooms with different configurations for each room. The configuration should be taken from one file.

rainbowbismuth, I'm happy to write this after I read over your code. If you'd like to do it, though, please feel free!

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.