random defaults
This commit is contained in:
parent
ba467507e0
commit
88dcde4c53
1 changed files with 17 additions and 10 deletions
|
@ -21,17 +21,24 @@ 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(
|
||||||
const json = await (
|
I18n.webhooks.name(),
|
||||||
await fetch(`${guild.info.api}/channels/${channel}/webhooks/`, {
|
async (name) => {
|
||||||
method: "POST",
|
const json = await (
|
||||||
headers: guild.headers,
|
await fetch(`${guild.info.api}/channels/${channel}/webhooks/`, {
|
||||||
body: JSON.stringify({name}),
|
method: "POST",
|
||||||
})
|
headers: guild.headers,
|
||||||
).json();
|
body: JSON.stringify({name}),
|
||||||
makeHook(json);
|
})
|
||||||
});
|
).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(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue