GithubHelp home page GithubHelp logo

ritsu's Introduction

Bot logo

Ritsu

An always-online Discord bot to fetch information from various API

Info

  • ๐Ÿ“„ Licensed under Apache-2.0
  • โš™๏ธ Requires TypeScript 4.9 or 4.9+ (particularly due to use of satisfies operator)
  • โš™๏ธ Uses ES modules and not CJS
  • ๐Ÿš€ Minimal amount of dependencies
  • ๐Ÿ”ถ Powered by Cloudflare Workers
  • ๐Ÿ”— Bot Invite Link

Features

  • Searching and fetching articles from Wikipedia.
  • Searching and fetching articles from various fandom pages.
  • Searching and fetching the details of a compound from PubChem using their PUG API.

How to run this bot

  1. Install node.js and npm.
  2. Clone this repository: git clone https://github.com/supershadoe/ritsu.
  3. Create a worker in Cloudflare's dashboard.
  4. Run npm update to download all node modules.
  5. Set your worker's name and domain/routes in wrangler.toml.
  6. Login to your Cloudflare account using wrangler: npx wrangler login.
  7. Run a locally hosted bot for development purposes using npx wrangler dev additionally with --local if you want to just use miniflare and not connect to a Cloudflare server for using KV and durable objects (this bot doesn't need those right now).
  8. Upload the code to run serverlessly on any cloudflare datacenter using npx wrangler publish.

ritsu's People

Contributors

supershadoe avatar

Stargazers

 avatar

Watchers

James Cloos avatar Kostas Georgiou avatar  avatar

Forkers

kjeymax

ritsu's Issues

Implement ratelimits for PubChem command

According to their usage policy,

USAGE POLICY: Please note that PUG REST is not designed for very large volumes (millions) of requests.
We ask that any script or application not make more than 5 requests per second, in order to avoid overloading the PubChem servers.

Side note from me:
Due to the above usage policy, it's not easily possible to add an autocomplete feature for compounds in slash command.
I would either need to download the entire DB and write code to cache it efficiently and fetch data... There's no way around it.
Spotty autocomplete which works sporadically due to ratelimits is kinda useless, innit?

Add cache in PubChem command

  • Although it's one of the rarely used (and only one of the 2 commands on this small bot), it's probably better to have some sort of cache of responses from PubChem

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.