From 0e6d7db59c0c6680319fe00238c5e56067edf583 Mon Sep 17 00:00:00 2001 From: ayntee Date: Fri, 1 Jan 2021 11:20:02 +0400 Subject: [PATCH] docs: remove releasenotes.md --- docs/src/releasenotes.md | 96 ---------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 docs/src/releasenotes.md diff --git a/docs/src/releasenotes.md b/docs/src/releasenotes.md deleted file mode 100644 index 67847cd74..000000000 --- a/docs/src/releasenotes.md +++ /dev/null @@ -1,96 +0,0 @@ -# Discordeno v10 Release Notes - -From breaking changes to small bug fixes to QoL improvements, this release has it all. This is Discordeno Next! - -## Slash Commands and Interactions - -A Slash Command is a command that you register for your application. It consists of a name, description, and a block of options, which you can think of like arguments to a function. - -An Interaction is the message that your application receives when a user uses a command. - -Discordeno, from v10 or newer, has inbuilt support for both slash commands and interactions. For a quick start, check out our [official boilerplate for slash commands](https://github.com/discordeno/discordeno-slashbot-boilerplate). - -![slash commands](https://media.discordapp.net/attachments/792215444106903562/793042919820099634/unknown.png) - -## Getters for Structures - -Getters are introduced in Discordeno v10 as a QoL improvement. - -- v9 or before - -```ts -import { sendMessage } from "discordeno"; - -await sendMessage("Channel ID", "Content"); -... -``` - -- v10 or newer - -```ts -message.send("Content"); -``` - -## Permission enums to Permission strings - -This change is a breaking change, it increases consistency by enabling users to use consistent API throughout their code. - -- v9 or before: - -```ts -import { hasChannelPermissions, Permissions } from "discordeno"; - -await hasChannelPermissions( - "Channel ID", - "User ID", - [Permissions.MANAGE_MESSAGES] -); -``` - -- v10 or newer: - -```ts -import { hasChannelPermissions } from "discordeno"; - -await hasChannelPermissions("Channel ID", "User ID", ["MANAGE_MESSAGES"]); -``` - -## Guild.channels and Guild.members as Getters - -These changes were made to optimize memory. To properly explain these changes, let's take an example of a user in X number of guilds, previously, in v9 or before, the member object was cached X times. However, with the release of v10, it stores the member object only once, hence saving memory. - -Similarly, `Guild.channels` is converted into a getter in v10 or newer. This is removed because it was storing duplicated values from `cache.channels`, and hence taking additional memory. - -## Improved WebSocket Close Errors - -- v9 or before: - -```ts -import { createClient } from "discordeno"; - -createClient({ - token: "BOT TOKEN", - // Invalid intents - intents: [1234567890] -}); - -// throws: "Shard.ts: Error occurred that is not resumeable or able to be reconnected." -``` - -- v10 or later: - -```ts -import { startBot } from "discordeno"; - -startBot({ - token: "BOT TOKEN", - intents: [1234567890] -}); - -// throws: "[Invalid intent(s)] Sent an invalid intent for a Gateway Intent." -``` - -If you are already using Discordeno, you can update to `v10` by updating the import URL for Discordeno to the following, usually present in `deps.ts` file. -``` -https://deno.land/x/discordeno@10.0.0/mod.ts -```