Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/polish-penguin-dev/twicord
Twilight Discord - Discord Bots With Ease.
https://github.com/polish-penguin-dev/twicord
Last synced: 20 days ago
JSON representation
Twilight Discord - Discord Bots With Ease.
- Host: GitHub
- URL: https://github.com/polish-penguin-dev/twicord
- Owner: polish-penguin-dev
- License: mit
- Created: 2024-08-25T20:50:41.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-10-30T12:25:58.000Z (3 months ago)
- Last Synced: 2024-11-07T06:18:59.664Z (2 months ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TwiCord
- An Extremely Simple Oceanic.js Wrapper That Makes It Easy To Create Analog And Slash Commands! 🌈
- NOT Actively Maintained! Last Edited On Wed, Oct 30 2024.
- Uses EXPERIMENTAL IMPORTS. Run `[node/bun/deno] --no-warnings .` To Fix!
- Bun Runtime Is Recommended.Features:
- Slash Commands
- Analog Commands
- Component Handlers
- Command Handler
- Easy Colors/OptionTypes (Lists)
- Embed Builderindex.js:
```js
import { Client } from "oceanic.js";
import { Twi } from "twicord.js";const client = new Client({ auth: `Bot ${process.env.token}`, gateway: { intents: [...] } });
const twi = new Twi(client);twi.cmdhandler("./cmds");
export { twi };
```cmds/ping.js:
```js
import { twi } from "../index.js";twi.slashcmd({
name: "ping",
description: "Pong!",
run: async function(interaction) {
interaction.createMessage({ content: "Pong!" });
}
});twi.analogcmd({
name: "!ping",
run: function(message) {
//twi.message() = client.rest.channels.createMessage()
twi.message(message.channel.id, { content: "Pong!" });
}
});
```showcase:
```js
import { twi } from "../index.js";//Slash Command
twi.slashcmd({
name: "cuckoo",
description: "Repeats!",
options: [
{
type: twi.optiontype("string"),
name: "message",
description: "Message To Repeat",
required: true
}
],
run: async function(interaction) {
const msg = interaction.data.options.getString("message");//Embed Builder
const response = twi.embed()
.title("Repeat")
.description(msg)
.color(twi.color("blurple")) //twi.x(...) Lists
.build();//Components
interaction.createMessage({
embeds: [response],
components: [
{
type: twi.componenttype("actionrow"),
components: [
{
type: twi.componenttype("button"),
style: 1,
customID: "info",
label: "Information"
}
]
}
]
});
}
});//Handle Components
twi.handlecomponents({
customid: "info",
run: async function(interaction) {
await interaction.createMessage({ content: "Made With Twicord.js + Oceanic.js" });
}
});
```NPM: https://npmjs.com/package/twicord.js,
JSR: https://jsr.io/@twicordjs/core