mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
refactor!: organize directories and files (#268)
* refactor!: organize directory structure * fix: avoid stack overflow err * chore: swtch back to std/encoding for base64 * style: format source files
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
import { RoleData, Unpromise } from "../types/types.ts";
|
||||
|
||||
export async function createRole(data: RoleData) {
|
||||
const { tags, ...rest } = data;
|
||||
|
||||
const roleTags = {
|
||||
botID: tags?.bot_id,
|
||||
premiumSubscriber: "premium_subscriber" in (tags ?? {}),
|
||||
integrationID: tags?.integration_id,
|
||||
};
|
||||
|
||||
return {
|
||||
...rest,
|
||||
/** The @ mention of the role in a string. */
|
||||
mention: `<@&${data.id}>`,
|
||||
tags: roleTags,
|
||||
};
|
||||
}
|
||||
|
||||
export interface Role extends Unpromise<ReturnType<typeof createRole>> {}
|
||||
Reference in New Issue
Block a user