mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
21 lines
438 B
TypeScript
21 lines
438 B
TypeScript
import {
|
|||
|
|
ButtonBuilder,
|
||
|
|
ButtonStyle,
|
||
|
|
ComponentEmojiResolvable,
|
||
|
|
} from 'discord.js';
|
||
|
|
import { CYCLIC_API } from '../../constants/cyclic.js';
|
||
|
|
|
||
|
|
export default function linkButton(
|
||
|
|
id: string,
|
||
|
|
label: string,
|
||
|
|
emoji?: ComponentEmojiResolvable,
|
||
|
|
) {
|
||
|
|
const button = new ButtonBuilder()
|
||
|
|
.setStyle(ButtonStyle.Link)
|
||
|
|
.setURL(`${CYCLIC_API}/${id}`)
|
||
|
|
.setLabel(label);
|
||
|
|
|
||
|
|
if (emoji) button.setEmoji(emoji);
|
||
|
|
|
||
|
|
return button;
|
||
|
|
}
|