random defaults

This commit is contained in:
MathMan05 2025-03-23 20:06:13 -05:00
parent ba467507e0
commit 88dcde4c53

View file

@ -21,8 +21,11 @@ async function webhookMenu(
webhooks.addButtonInput("", I18n.webhooks.newWebHook(), () => { webhooks.addButtonInput("", I18n.webhooks.newWebHook(), () => {
const nameBox = new Dialog(I18n.webhooks.EnterWebhookName()); const nameBox = new Dialog(I18n.webhooks.EnterWebhookName());
const options = nameBox.float.options; const options = nameBox.float.options;
const defualts = I18n.webhooks.sillyDefaults().split("\n");
let channel = channelId || moveChannels[0].id; let channel = channelId || moveChannels[0].id;
options.addTextInput(I18n.webhooks.name(), async (name) => { options.addTextInput(
I18n.webhooks.name(),
async (name) => {
const json = await ( const json = await (
await fetch(`${guild.info.api}/channels/${channel}/webhooks/`, { await fetch(`${guild.info.api}/channels/${channel}/webhooks/`, {
method: "POST", method: "POST",
@ -31,7 +34,11 @@ async function webhookMenu(
}) })
).json(); ).json();
makeHook(json); makeHook(json);
}); },
{
initText: defualts[Math.floor(Math.random() * defualts.length)],
},
);
if (!channelId) { if (!channelId) {
const select = options.addSelect( const select = options.addSelect(
I18n.webhooks.channel(), I18n.webhooks.channel(),