mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-19 05:55:34 +09:00
feat(guild): duplicate role, plus delete and hover in roles sidebar (#2105)
This commit is contained in:
1 parent
19efbd3d61
commit
8f20b29b16
6 files changed
+198
-16
No files matched your search
@@ -254,10 +254,11 @@ export async function updateVanityURL(guildId: string, code: string | null): Pro
|
||||
}
|
||||
}
|
||||
|
||||
export async function createRole(guildId: string, name: string): Promise<void> {
|
||||
export async function createRole(guildId: string, name: string): Promise<GuildRole> {
|
||||
try {
|
||||
await http.post(Endpoints.GUILD_ROLES(guildId), {body: {name}});
|
||||
const response = await http.post<GuildRole>(Endpoints.GUILD_ROLES(guildId), {body: {name}});
|
||||
logger.debug(`Created role "${name}" in guild ${guildId}`);
|
||||
return response.body;
|
||||
} catch (error) {
|
||||
logger.error(`Failed to create role in guild ${guildId}:`, error);
|
||||
throw error;
|
||||
|
||||
Reference in new issue
Block a user