chore: refactor asyncResponse to take a preflight response

This commit is contained in:
41666 2021-08-07 18:04:29 -04:00
parent 26bc74bcbc
commit 76a03c2d2c
3 changed files with 21 additions and 8 deletions

View file

@ -1,5 +1,8 @@
import { selectRole } from '@roleypoly/interactions/utils/api';
import { asyncResponse } from '@roleypoly/interactions/utils/interactions';
import {
asyncPreflightEphemeral,
asyncResponse,
} from '@roleypoly/interactions/utils/interactions';
import { invalid, mustBeInGuild } from '@roleypoly/interactions/utils/responses';
import {
InteractionCallbackType,
@ -78,5 +81,6 @@ export const pickRole = (mode: 'add' | 'remove') =>
flags: InteractionFlags.EPHEMERAL,
},
};
}
},
asyncPreflightEphemeral
);

View file

@ -1,6 +1,9 @@
import { getPickableRoles } from '@roleypoly/interactions/utils/api';
import { uiPublicURI } from '@roleypoly/interactions/utils/config';
import { asyncResponse } from '@roleypoly/interactions/utils/interactions';
import {
asyncPreflightEphemeral,
asyncResponse,
} from '@roleypoly/interactions/utils/interactions';
import { mustBeInGuild } from '@roleypoly/interactions/utils/responses';
import {
CategoryType,
@ -55,5 +58,6 @@ export const pickableRoles = asyncResponse(
],
},
};
}
},
asyncPreflightEphemeral
);