mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
chore: getGuild should use enum authType
This commit is contained in:
parent
990ac3f3ca
commit
0e33aa8112
1 changed files with 6 additions and 2 deletions
|
@ -32,7 +32,11 @@ export const getGuild = cacheLayer(
|
||||||
Guilds,
|
Guilds,
|
||||||
(id: string) => `guilds/${id}`,
|
(id: string) => `guilds/${id}`,
|
||||||
async (id: string) => {
|
async (id: string) => {
|
||||||
const guildRaw = await discordFetch<APIGuild>(`/guilds/${id}`, botToken, 'Bot');
|
const guildRaw = await discordFetch<APIGuild>(
|
||||||
|
`/guilds/${id}`,
|
||||||
|
botToken,
|
||||||
|
AuthType.Bot
|
||||||
|
);
|
||||||
|
|
||||||
if (!guildRaw) {
|
if (!guildRaw) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -92,7 +96,7 @@ type APIMember = {
|
||||||
roles: string[];
|
roles: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
const guildMemberRolesIdentity = ({ serverID, userID }) =>
|
const guildMemberRolesIdentity = ({ serverID, userID }: GuildMemberIdentity) =>
|
||||||
`guilds/${serverID}/members/${userID}`;
|
`guilds/${serverID}/members/${userID}`;
|
||||||
|
|
||||||
export const getGuildMemberRoles = cacheLayer<GuildMemberIdentity, Role['id'][]>(
|
export const getGuildMemberRoles = cacheLayer<GuildMemberIdentity, Role['id'][]>(
|
||||||
|
|
Loading…
Add table
Reference in a new issue