From ec3a6f21e208eb52f2f97b5a07252878ee3cbd57 Mon Sep 17 00:00:00 2001 From: ayntee Date: Tue, 3 Nov 2020 05:26:43 -0800 Subject: [PATCH 01/12] Add Role.tags property --- src/structures/role.ts | 5 +++++ src/types/role.ts | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/structures/role.ts b/src/structures/role.ts index 8f8f87e3d..9179c06d8 100644 --- a/src/structures/role.ts +++ b/src/structures/role.ts @@ -6,6 +6,11 @@ export async function createRole(data: RoleData) { ...data, /** The @ mention of the role in a string. */ mention: `<@&${data.id}>`, + tags: { + botID: data.tags?.botID, + premiumSubscriber: "premium_subscriber" in (data.tags ?? {}), + integrationID: data.tags?.integrationID, + }, }; } diff --git a/src/types/role.ts b/src/types/role.ts index 743330a71..78011d198 100644 --- a/src/types/role.ts +++ b/src/types/role.ts @@ -15,4 +15,12 @@ export interface RoleData { managed: boolean; /** whether this role is mentionable */ mentionable: boolean; + /** */ + tags: RoleTags | null; +} + +export interface RoleTags { + botID?: string; + premiumSubscriber?: boolean; + integrationID?: string; } From fc9b7215036af123db5304a8525c4476b1c2b26d Mon Sep 17 00:00:00 2001 From: ayntee Date: Tue, 3 Nov 2020 05:50:02 -0800 Subject: [PATCH 02/12] Oopsie --- src/structures/role.ts | 16 ++++++++++------ src/types/role.ts | 6 +++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/structures/role.ts b/src/structures/role.ts index 9179c06d8..e6b598b46 100644 --- a/src/structures/role.ts +++ b/src/structures/role.ts @@ -2,15 +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 (data.tags ?? {}), + integrationID: data.tags?.integration_id, + }; + return { - ...data, + ...rest, /** The @ mention of the role in a string. */ mention: `<@&${data.id}>`, - tags: { - botID: data.tags?.botID, - premiumSubscriber: "premium_subscriber" in (data.tags ?? {}), - integrationID: data.tags?.integrationID, - }, + tags: roleTags, }; } diff --git a/src/types/role.ts b/src/types/role.ts index 78011d198..0139a2906 100644 --- a/src/types/role.ts +++ b/src/types/role.ts @@ -20,7 +20,7 @@ export interface RoleData { } export interface RoleTags { - botID?: string; - premiumSubscriber?: boolean; - integrationID?: string; + bot_id?: string; + premium_subscriber?: boolean; + integration_id?: string; } From e93eaecc4ec44bc474c5af3f3e306bf5cc0d1e23 Mon Sep 17 00:00:00 2001 From: ayntee Date: Wed, 4 Nov 2020 05:36:16 -0800 Subject: [PATCH 03/12] Change type of RoleTags.premium_subscriber to null --- src/types/role.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/role.ts b/src/types/role.ts index 0139a2906..8793f93f7 100644 --- a/src/types/role.ts +++ b/src/types/role.ts @@ -21,6 +21,6 @@ export interface RoleData { export interface RoleTags { bot_id?: string; - premium_subscriber?: boolean; + premium_subscriber?: null; integration_id?: string; } From 8167d814828f02dfe1ad0c47736438deda56739c Mon Sep 17 00:00:00 2001 From: ayntee Date: Wed, 4 Nov 2020 05:37:17 -0800 Subject: [PATCH 04/12] Add description for `RoleData.tags` Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> --- src/types/role.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/role.ts b/src/types/role.ts index 8793f93f7..da51cde2f 100644 --- a/src/types/role.ts +++ b/src/types/role.ts @@ -15,7 +15,7 @@ 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; } From feab857ba60ad5511ddbb8be06d13309a921f96e Mon Sep 17 00:00:00 2001 From: ayntee Date: Wed, 11 Nov 2020 13:15:17 +0400 Subject: [PATCH 05/12] Update role.ts --- src/structures/role.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/role.ts b/src/structures/role.ts index e6b598b46..eb9b8f27f 100644 --- a/src/structures/role.ts +++ b/src/structures/role.ts @@ -6,7 +6,7 @@ export async function createRole(data: RoleData) { const roleTags = { botID: tags?.bot_id, - premiumSubscriber: "premium_subscriber" in (data.tags ?? {}), + premiumSubscriber: Boolean(data.tags?.premium_subscriber), integrationID: data.tags?.integration_id, }; From f3e8673dff55422a4f000cde0faa08dd9e54f354 Mon Sep 17 00:00:00 2001 From: ayntee Date: Wed, 11 Nov 2020 19:50:47 +0400 Subject: [PATCH 06/12] Revert "Update role.ts" This reverts commit feab857ba60ad5511ddbb8be06d13309a921f96e. --- src/structures/role.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/role.ts b/src/structures/role.ts index eb9b8f27f..e6b598b46 100644 --- a/src/structures/role.ts +++ b/src/structures/role.ts @@ -6,7 +6,7 @@ export async function createRole(data: RoleData) { const roleTags = { botID: tags?.bot_id, - premiumSubscriber: Boolean(data.tags?.premium_subscriber), + premiumSubscriber: "premium_subscriber" in (data.tags ?? {}), integrationID: data.tags?.integration_id, }; From 02dce94ada0cc8c331d29c586028606cb4578dac Mon Sep 17 00:00:00 2001 From: ayntee Date: Wed, 11 Nov 2020 19:53:12 +0400 Subject: [PATCH 07/12] data.tags -> tags --- src/structures/role.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/role.ts b/src/structures/role.ts index e6b598b46..87dd84f60 100644 --- a/src/structures/role.ts +++ b/src/structures/role.ts @@ -6,8 +6,8 @@ export async function createRole(data: RoleData) { const roleTags = { botID: tags?.bot_id, - premiumSubscriber: "premium_subscriber" in (data.tags ?? {}), - integrationID: data.tags?.integration_id, + premiumSubscriber: "premium_subscriber" in (tags ?? {}), + integrationID: tags?.integration_id, }; return { From ff711d622a74a57cd02c5328b7b8e7017da94026 Mon Sep 17 00:00:00 2001 From: ayntee Date: Wed, 11 Nov 2020 20:00:17 +0400 Subject: [PATCH 08/12] Add missing JSDoc for RoleTags --- src/types/role.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/types/role.ts b/src/types/role.ts index da51cde2f..aaae41b90 100644 --- a/src/types/role.ts +++ b/src/types/role.ts @@ -20,7 +20,10 @@ export interface RoleData { } 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; } From 7bf6774d537fe73924a893bb57a7b952d6b05501 Mon Sep 17 00:00:00 2001 From: ayntee Date: Tue, 24 Nov 2020 21:07:11 +0400 Subject: [PATCH 09/12] Remove "Features" header --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index bee989bf3..edf0b709c 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 From 4739a322c34ea7e3153ed3b45ab63f82c26aee84 Mon Sep 17 00:00:00 2001 From: ayntee Date: Tue, 24 Nov 2020 21:12:03 +0400 Subject: [PATCH 10/12] Add "Contributing" header --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index edf0b709c..14f008cf4 100644 --- a/README.md +++ b/README.md @@ -52,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) From 1a4fe647e4c7d6718abff484e166613115d1c7f6 Mon Sep 17 00:00:00 2001 From: TheBlueOompaLoompa <53215039+TheBlueOompaLoompa@users.noreply.github.com> Date: Wed, 25 Nov 2020 20:45:47 -0600 Subject: [PATCH 11/12] Fix spelling error in guild.ts Fixed the extra uppercase letter in the comment for unban. --- src/handlers/guild.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handlers/guild.ts b/src/handlers/guild.ts index bb96903fd..ea09d08c2 100644 --- a/src/handlers/guild.ts +++ b/src/handlers/guild.ts @@ -564,7 +564,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, [Permissions.BAN_MEMBERS]); if (!hasPerm) { From b484c2cc98df088da6763a417535de0761dd2fdf Mon Sep 17 00:00:00 2001 From: ayntee Date: Fri, 27 Nov 2020 10:13:46 -0800 Subject: [PATCH 12/12] Update Discordeno version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 14f008cf4..b1d6a2d4a 100644 --- a/README.md +++ b/README.md @@ -30,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",