react-discord
TypeScript icon, indicating that this package has built-in type declarations

0.1.17 • Public • Published

React-Discord

Introduction

React-discord is a small react-reconciler to use with Discord.js to make bot flows using text messages.

This library only provides only 2 host components:

  • Embed
  • Text

Both components make use of reactions to enable interactivity.

Example

import Discord from "discord.js";
import React from "react";
import ReactDiscord, { DiscordS, Embed, RootContainer } from "react-discord";
 
function MyComponent(props) {
  return <Embed title={props.text} description="Lorem ipsum dolor sit amet" />;
}
 
const rootContainer = new RootContainer(
  YOUR_DISCORD_CLIENT,
  textChannel, // <- You need to provide a text channel from the discord.js library
);
 
ReactDiscord.render(<MyComponent text="Hello World!" />, rootContainer);

Package Sidebar

Install

npm i react-discord

Weekly Downloads

0

Version

0.1.17

License

MIT

Unpacked Size

55.4 kB

Total Files

55

Last publish

Collaborators

  • maxizipitria