# discord-api-helper

> Discord API Helper is a package that simplifies sending messages to Discord channels using the Discord API. This package uses Axios to make HTTP requests to the Discord API, allowing you to send messages easily.

Latest version **0.1.0** (published 2023-10-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install discord-api-helper
pnpm add discord-api-helper
yarn add discord-api-helper
bun add discord-api-helper
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2023-10-10 |
| First published | 2023-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 19.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tedante |

## Links

- npm: https://www.npmjs.com/package/discord-api-helper
- npm.io page: https://npm.io/package/discord-api-helper

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^1.5.1

## Recent versions

- 0.1.0 (latest) — 2023-10-10

## README

# Discord API Helper

Discord API Helper is a package that simplifies sending messages to Discord channels using the Discord API. This package uses Axios to make HTTP requests to the Discord API, allowing you to send messages easily.

## Installation

To use Discord API Helper in your project, you can install it via npm or yarn:

```bash
npm install discord-api-helper
# or
yarn add discord-api-helper
```

## Usage
1. Import the Discord class from the package in your TypeScript code:
```typescript
import Discord from 'discord-api-helper';
```
2. Create an instance of the Discord class by providing your Discord bot's base URL and access token:
```typescript
const discord = new Discord('YOUR_DISCORD_BASE_URL', 'YOUR_DISCORD_ACCESS_TOKEN');
```
3. Send a message to a Discord channel using the sendMessageToChannel method:

```typescript
const channelId = 'YOUR_CHANNEL_ID'; // Replace with your channel ID
const message = 'Hello, Discord!';

discord.sendMessageToChannel(channelId, message)
  .then((response) => {
    console.log('Message sent:', response);
  })
  .catch((error) => {
    console.error('Error sending message:', error);
  });
```
> Make sure to replace 'YOUR_DISCORD_BASE_URL', 'YOUR_DISCORD_ACCESS_TOKEN', and 'YOUR_CHANNEL_ID' with your actual Discord base URL, access token, and the channel ID where you want to send the message.
 
## Contribution

Contributions and issues are welcome! If you find a bug or want to add a feature, please open an issue on GitHub or create a pull request.

---
_Source: https://npm.io/package/discord-api-helper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
