diff --git a/README.md b/README.md index bee989bf3..b1d6a2d4a 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ ![Test](https://github.com/Skillz4Killz/Discordeno/workflows/Test/badge.svg) [![nest badge](https://nest.land/badge.svg)](https://nest.land/package/Discordeno) -## Features - - First-class TypeScript & JavaScript support - Security & stable - Builtin Documentation @@ -32,7 +30,7 @@ If you do not wish to use a boilerplate, you may continue reading. Here's a minimal example to get started with: ```typescript -import StartBot, { sendMessage, Intents } from "https://x.nest.land/Discordeno@9.0.15/mod.ts"; +import StartBot, { sendMessage, Intents } from "https://x.nest.land/Discordeno@9.4.0/mod.ts"; StartBot({ token: "BOT TOKEN", @@ -54,6 +52,18 @@ StartBot({ - [Support server](https://discord.gg/J4NqJ72) - [Contributing Guide](https://github.com/Skillz4Killz/Discordeno/blob/master/.github/CONTRIBUTING.md) -## License +## Contributing + +## Code of Conduct + +Discordeno expects participants to adhere to our [Code of Conduct](https://github.com/Skillz4Killz/Discordeno/blob/master/.github/CODE_OF_CONDUCT.md). + +## Contributing Guide + +We appreciate your help! + +Before contributing, please read the [Contributing Guide](https://github.com/Skillz4Killz/Discordeno/blob/master/.github/CONTRIBUTING.md). + +### License [MIT © Skillz4Killz](https://github.com/Skillz4Killz/Discordeno/blob/master/LICENSE) diff --git a/src/handlers/guild.ts b/src/handlers/guild.ts index e9de23f58..86936b3af 100644 --- a/src/handlers/guild.ts +++ b/src/handlers/guild.ts @@ -565,7 +565,7 @@ export async function ban(guildID: string, id: string, options: BanOptions) { ); } -/** Remove the ban for a user. REquires BAN_MEMBERS permission */ +/** Remove the ban for a user. Requires BAN_MEMBERS permission */ export async function unban(guildID: string, id: string) { const hasPerm = await botHasPermission(guildID, ["BAN_MEMBERS"]); if (!hasPerm) { diff --git a/src/structures/role.ts b/src/structures/role.ts index 8f8f87e3d..87dd84f60 100644 --- a/src/structures/role.ts +++ b/src/structures/role.ts @@ -2,10 +2,19 @@ import { Unpromise } from "../types/misc.ts"; import { RoleData } from "../types/role.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 { - ...data, + ...rest, /** The @ mention of the role in a string. */ mention: `<@&${data.id}>`, + tags: roleTags, }; } diff --git a/src/types/role.ts b/src/types/role.ts index 743330a71..aaae41b90 100644 --- a/src/types/role.ts +++ b/src/types/role.ts @@ -15,4 +15,15 @@ export interface RoleData { managed: boolean; /** whether this role is mentionable */ mentionable: boolean; + /** Certain roles may have tags that allow you to determine if this role is related to a bot, an integration, or the booster role. */ + tags: RoleTags | null; +} + +export interface RoleTags { + /** the id of the bot who has this role */ + bot_id?: string; + /** whether this is the premium subscriber role for this guild */ + premium_subscriber?: null; + /** the id of the integration this role belongs to */ + integration_id?: string; }