cycle-discord-google-api

0.1.4 • Public • Published

Cycle.js Google API component for Discord

Usage

$ npm install cycle-discord-google-api
import {Observable} from 'rx'
import {run} from '@cycle/core'
import {makeHTTPDriver} from '@cycle/http'
import makeDiscordDriver from 'cycle-discord'
import {GoogleApi, IMAGE_SEARCH_URL} from 'cycle-discord-google-api'

run(GoogleApi, {
    HTTP: makeHTTPDriver(),
    Discord: makeDiscordDriver({/**/}),
    props: () => Observable.of({
        URL: `${IMAGE_SEARCH_URL}&key=YOUR_API_KEY`,
        trigger: /^search image (.*)$/,
        transform: result => result.link
    })
})

This example will add a listener on messages like search image foo bar and respond with the link of the result of a Google Image search

Package Sidebar

Install

npm i cycle-discord-google-api

Weekly Downloads

7

Version

0.1.4

License

MIT

Last publish

Collaborators

  • chadrien