Skip to content

Commit 88dcde4

Browse files
committed
random defaults
1 parent ba46750 commit 88dcde4

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

src/webpage/webhooks.ts

+17-10
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,24 @@ async function webhookMenu(
2121
webhooks.addButtonInput("", I18n.webhooks.newWebHook(), () => {
2222
const nameBox = new Dialog(I18n.webhooks.EnterWebhookName());
2323
const options = nameBox.float.options;
24+
const defualts = I18n.webhooks.sillyDefaults().split("\n");
2425
let channel = channelId || moveChannels[0].id;
25-
options.addTextInput(I18n.webhooks.name(), async (name) => {
26-
const json = await (
27-
await fetch(`${guild.info.api}/channels/${channel}/webhooks/`, {
28-
method: "POST",
29-
headers: guild.headers,
30-
body: JSON.stringify({name}),
31-
})
32-
).json();
33-
makeHook(json);
34-
});
26+
options.addTextInput(
27+
I18n.webhooks.name(),
28+
async (name) => {
29+
const json = await (
30+
await fetch(`${guild.info.api}/channels/${channel}/webhooks/`, {
31+
method: "POST",
32+
headers: guild.headers,
33+
body: JSON.stringify({name}),
34+
})
35+
).json();
36+
makeHook(json);
37+
},
38+
{
39+
initText: defualts[Math.floor(Math.random() * defualts.length)],
40+
},
41+
);
3542
if (!channelId) {
3643
const select = options.addSelect(
3744
I18n.webhooks.channel(),

0 commit comments

Comments
 (0)