Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Latest commit

 

History

History
46 lines (31 loc) · 1.16 KB

README.rst

File metadata and controls

46 lines (31 loc) · 1.16 KB

discord-ext-rx

package versions dependencies license cloned

Combine RxPy with discord.py.

⚠️ Work In Progress!

Installation

This extension is on PyPI.

$ python3 -m pip install -U discord-ext-rx

Usage

from discord.ext.rx import RxBot, _
from rx import operators as ops

bot = RxBot()

bot.messages.pipe(
    ops.filter(lambda m: m.author.id == 121678432504512512),
    ops.filter(lambda m: m.content == '418'),
    ops.map(lambda m: m.channel)
).subscribe(
    _(lambda c: c.send("I'm a teapot!"))
)

bot.run('token')