Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zastinian/hedystia.js
JavaScript library for interacting with the Discord API
https://github.com/zastinian/hedystia.js
client discord discord-api discord-client documentation hedystia nodejs
Last synced: 11 days ago
JSON representation
JavaScript library for interacting with the Discord API
- Host: GitHub
- URL: https://github.com/zastinian/hedystia.js
- Owner: Zastinian
- Created: 2022-07-12T00:15:46.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-17T23:01:36.000Z (7 months ago)
- Last Synced: 2024-10-13T19:34:14.333Z (25 days ago)
- Topics: client, discord, discord-api, discord-client, documentation, hedystia, nodejs
- Language: JavaScript
- Homepage: https://docs.hedystia.com/client/start/
- Size: 925 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Installation
```
npm i hedystia.jsyarn add hedystia.js
```## Nodejs Version
- `v18.6.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/client/start/)## All Examples
- [Examples](/Examples)
## To contribute to the project, please follow the steps below:
- Fork the repository.
- Create a new branch.
- Install dependencies.
- Make your changes: Make the necessary changes to the codebase in your branch using your preferred editor or IDE.
- Commit and push: Once you have made your changes, commit them and push the branch to your forked repository.
- Create a pull request.
## Example of 2
### Prefix
```js
const {Client, Intents, Status} = require("hedystia.js");const client = new Client({
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: "",
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/client/start")
.setAuthor({
name: "Name",
iconURL:
"https://media2.giphy.com/media/v1.Y2lkPTc5MGI3NjExZTMyYzU4YTVjNjNlZWUwZTgwN2ZiMDgxYzVlOGE0NGRhYTM3MmE1NCZjdD1z/K9svE9i7P3Ox2/giphy.gif",
url: "https://docs.hedystia.com/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/client/start")
.addFields({name: "Username", value: user.username, inline: true})
.setThumbnail({
url: user.displayAvatarURL(),
});
return interaction.reply({
content: `**${user.username}** Info`,
embeds: [userEmbed],
});
}
});
```