# hedystia.js

> JavaScript library for interacting with the Discord API

Latest version **1.13.1** (published 2024-02-07) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install hedystia.js
pnpm add hedystia.js
yarn add hedystia.js
bun add hedystia.js
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.13.1 |
| Published | 2024-02-07 |
| First published | 2023-04-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18.6.0 |
| Dependencies | 3 |
| Unpacked size | 1.2 MB |
| Known vulnerabilities | 0 (+5 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | contact@hedystia.com |
| Maintainers | zastinian |
| Keywords | client, discord, discord-client, discord-api, hedystia, nodejs, hedystia.js |

## Links

- npm: https://www.npmjs.com/package/hedystia.js
- Repository: https://github.com/Zastinian/Hedystia.js
- Homepage: https://docs.hedystia.com/docs/category/hedystiajs
- Issues: https://github.com/Zastinian/Hedystia.js/issues
- npm.io page: https://npm.io/package/hedystia.js

## Dependencies (3)

- [ws](https://npm.io/package/ws.md) 8.13.0
- [got](https://npm.io/package/got.md) 12.6.0
- [form-data](https://npm.io/package/form-data.md) 4.0.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.13.1 (latest) — 2024-02-07
- 1.13.0-dev.0.0.5 (dev) — 2023-10-10
- 1.13.0 — 2024-02-04
- 1.13.0-dev.0.0.4 — 2023-09-03
- 1.12.1 — 2023-09-03
- 1.13.0-dev.0.0.3 — 2023-08-03
- 1.13.0-dev.0.0.2 — 2023-07-29
- 1.13.0-dev.0.0.1 — 2023-07-26
- 1.12.0 — 2023-07-26
- 1.12.0-dev.0.0.9 — 2023-07-24
- 1.12.0-dev.0.0.8 — 2023-07-24
- 1.12.0-dev.0.0.7 — 2023-07-16
- 1.11.4 — 2023-07-16
- 1.12.0-dev.0.0.6 — 2023-07-14
- 1.11.3 — 2023-07-14
- … 27 more at https://npm.io/package/hedystia.js/versions

## README

## Installation

```
npm i hedystia.js

yarn add hedystia.js
```

## Nodejs Version

- `v16.9.0` or higher

## Links

- [Discord](https://discord.gg/aXvuUpvRQs) [Hedystia Discord]
- [Bot](https://discord.com/oauth2/authorize?client_id=931228076094930996&permissions=137710923254&scope=bot%20applications.commands) [Hedystia Discord Bot]
- [Docs](https://docs.hedystia.com/docs/client/start)

## Examples

### Prefix

```js
const {Client, Intents, Status} = require("hedystia.js");

const client = new Client({
  token: "<BOT_TOKEN>",
  intents: [Intents.Flags.Guilds, Intents.Flags.Guild_Members, Intents.Flags.Message_Content, Intents.Flags.Guild_Messages],
  presence: {
    status: Status.Idle,
    activities: [
      {
        name: "Hedystia",
        type: "Playing",
      },
    ],
  },
});

client.once("ready", () => {
  console.log("Bot on: " + client.user.username);
});

client.on("messageCreate", (msg) => {
  if (msg.content == "!ping") {
    msg.reply({
      content: "Pong!",
    });
  }
});
```

### Slash

```js
const {Client, Intents, Status, Slash, SlashOption, MessageEmbed, OptionType} = require("hedystia.js");

const client = new Client({
  token: "<BOT_TOKEN>",
  intents: [Intents.Flags.Guilds, Intents.Flags.Guild_Members],
  presence: {
    status: Status.Idle,
    activities: [
      {
        name: "Hedystia",
        type: "Playing",
      },
    ],
  },
});

client.once("ready", async () => {
  let slash = [
    new Slash().setName("help").setDescription("Help Command").setDmPermission(true),
    new Slash()
      .setName("user")
      .setDescription("User Command")
      .setDmPermission(false)
      .setOptions([new SlashOption().setName("user_option").setDescription("user").setRequired(true).setType(OptionType.User)]),
  ];
  client.application.commands.set(slash);
  console.log("Bot on: " + client.user.username);
});

client.on("interactionCreate", (interaction) => {
  if (!interaction.isCommand()) return;
  if (interaction.commandName == "help") {
    const helpEmbed = new MessageEmbed()
      .setColor(0x0099ff)
      .setTitle("Help Menu")
      .setURL("https://docs.hedystia.com/docs/client/start")
      .setAuthor({
        name: "Name",
        iconURL:
          "https://media2.giphy.com/media/v1.Y2lkPTc5MGI3NjExZTMyYzU4YTVjNjNlZWUwZTgwN2ZiMDgxYzVlOGE0NGRhYTM3MmE1NCZjdD1z/K9svE9i7P3Ox2/giphy.gif",
        url: "https://docs.hedystia.com/docs/client/start",
      })
      .setDescription("Help Description")
      .setThumbnail({
        url: "https://media2.giphy.com/media/v1.Y2lkPTc5MGI3NjExZTMyYzU4YTVjNjNlZWUwZTgwN2ZiMDgxYzVlOGE0NGRhYTM3MmE1NCZjdD1z/K9svE9i7P3Ox2/giphy.gif",
      })
      .addFields({name: "Command", value: "/help", inline: true}, {name: "Command", value: "/user", inline: true})
      .setImage({url: "https://c.tenor.com/yi5btxWVAwwAAAAC/tenor.gif"})
      .setTimestamp()
      .setFooter({
        text: "Footer",
        iconURL:
          "https://media2.giphy.com/media/v1.Y2lkPTc5MGI3NjExZTMyYzU4YTVjNjNlZWUwZTgwN2ZiMDgxYzVlOGE0NGRhYTM3MmE1NCZjdD1z/K9svE9i7P3Ox2/giphy.gif",
      });
    return interaction.reply({
      embeds: [helpEmbed],
    });
  } else if (interaction.commandName == "user") {
    const user = interaction.options.getUser("user_option");
    const userEmbed = new MessageEmbed()
      .setColor(0x0099ff)
      .setTitle("User Info")
      .setURL("https://docs.hedystia.com/docs/client/start")
      .addFields({name: "Username", value: user.username, inline: true})
      .setThumbnail({
        url: user.displayAvatarURL(),
      });
    return interaction.reply({
      content: `**${user.username}** Info`,
      embeds: [userEmbed],
    });
  }
});
```

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