-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
304 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
out/ | ||
node_modules/ | ||
yarn.lock | ||
test/ | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* Clean up out dir */ | ||
|
||
import { readdir, stat } from "node:fs/promises"; | ||
import rimraf from "rimraf"; | ||
|
||
const dirs = await readdir("./out"); | ||
const rimrafp = (path) => new Promise((resolve, reject) => { | ||
rimraf(path, (err) => err ? reject(err) : resolve()); | ||
}); | ||
|
||
for (const dirname of dirs) { | ||
const dir = await stat(`./out/${dirname}`, { throwIfNoEntry: false }); | ||
if (!dir.isDirectory()) continue; | ||
await rimrafp(`./out/${dirname}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"use strict"; | ||
|
||
var _index = require("../out/index"); | ||
|
||
/** @jsx DiscordComponents.createComponent */ | ||
|
||
/** @jsxFrag DiscordComponents.Fragment */ | ||
var components = _index.DiscordComponents.createComponent(_index.DiscordComponents.Fragment, null, _index.DiscordComponents.createComponent(_index.MessageActionRow, null, Array.from({ | ||
length: 5 | ||
}, function (_, i) { | ||
return _index.DiscordComponents.createComponent(_index.MessageButton, { | ||
style: "PRIMARY", | ||
label: "Button ".concat(++i), | ||
customId: "btn_".concat(i) | ||
}); | ||
})), _index.DiscordComponents.createComponent(_index.MessageActionRow, null, _index.DiscordComponents.createComponent(_index.MessageSelectMenu, { | ||
customId: "123" | ||
}, Array.from({ | ||
length: 5 | ||
}, function (_, i) { | ||
return _index.DiscordComponents.createComponent(_index.MessageSelectOption, { | ||
description: "Option number ".concat(++i), | ||
label: "Option ".concat(i), | ||
value: i.toString() | ||
}); | ||
}))), _index.DiscordComponents.createComponent(_index.MessageEmbed, { | ||
color: "BLURPLE", | ||
title: "Counter" | ||
}, _index.DiscordComponents.createComponent(_index.MessageEmbedFields, null, Array.from({ | ||
length: 10 | ||
}, function (_, i) { | ||
var counter = ++i; | ||
return _index.DiscordComponents.createComponent(_index.MessageEmbedField, { | ||
name: "Count ".concat(counter), | ||
value: "Counting ".concat(counter) | ||
}); | ||
})))); | ||
|
||
console.log("BABEL", components); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** @jsx DiscordComponents.createComponent */ | ||
/** @jsxFrag DiscordComponents.Fragment */ | ||
|
||
import { | ||
DiscordComponents, | ||
MessageActionRow, | ||
MessageSelectMenu, | ||
MessageSelectOption, | ||
MessageButton, | ||
MessageEmbed, | ||
MessageEmbedAuthor, | ||
MessageEmbedFields, | ||
MessageEmbedField, | ||
MessageEmbedFooter, | ||
MessageEmbedImage, | ||
MessageEmbedThumbnail, | ||
} from "../out/index"; | ||
|
||
const components = ( | ||
<> | ||
<MessageActionRow> | ||
{Array.from({ length: 5 }, (_, i) => ( | ||
<MessageButton style="PRIMARY" label={`Button ${++i}`} customId={`btn_${i}`} /> | ||
))} | ||
</MessageActionRow> | ||
<MessageActionRow> | ||
<MessageSelectMenu customId="123"> | ||
{Array.from({ length: 5 }, (_, i) => ( | ||
<MessageSelectOption description={`Option number ${++i}`} label={`Option ${i}`} value={i.toString()} /> | ||
))} | ||
</MessageSelectMenu> | ||
</MessageActionRow> | ||
<MessageEmbed color="BLURPLE" title="Counter"> | ||
<MessageEmbedFields> | ||
{Array.from({ length: 10 }, (_, i) => { | ||
const counter = ++i; | ||
return <MessageEmbedField name={`Count ${counter}`} value={`Counting ${counter}`} /> | ||
})} | ||
</MessageEmbedFields> | ||
</MessageEmbed> | ||
</> | ||
); | ||
|
||
console.log("BABEL", components); |
Oops, something went wrong.