Discord API library for Node and Deno
APACHE-2.0 License
Bot releases are visible (Hide)
Full Changelog: https://github.com/discordeno/discordeno/compare/17.0.1...17.2.0
Published by Skillz4Killz almost 2 years ago
Full Changelog: https://github.com/discordeno/discordeno/compare/17.0.0...17.0.1
Published by Skillz4Killz about 2 years ago
Full Changelog: https://github.com/discordeno/discordeno/compare/16.0.1...17.0.0
Published by Skillz4Killz about 2 years ago
two_way_link
to DiscordConnection
by @itohatweb in https://github.com/discordeno/discordeno/pull/2481
Full Changelog: https://github.com/discordeno/discordeno/compare/16.0.0...16.0.1
Published by Skillz4Killz about 2 years ago
This release was mainly made because we updated a dependency
"undici" for node.js users. This dependency had a breaking change, so we bumped it to 16. While this was a breaking change, i also merged two pending breaking change prs that were finalized. Some functions that discord no longer supports, we removed and the name of a permission was changed since discord changed it as well.
The main thing that will break in your bots, is most like the name change of MANAGE_EMOJIS
=> MANAGE_EMOJIS_AND_STICKERS
Full Changelog: https://github.com/discordeno/discordeno/compare/15.0.4...16.0.0
Published by Skillz4Killz about 2 years ago
Full Changelog: https://github.com/discordeno/discordeno/compare/15.0.3...15.0.4
Published by Skillz4Killz about 2 years ago
Full Changelog: https://github.com/discordeno/discordeno/compare/15.0.2...15.0.3
Published by Skillz4Killz about 2 years ago
Full Changelog: https://github.com/discordeno/discordeno/compare/15.0.1...15.0.2
Published by Skillz4Killz about 2 years ago
Full Changelog: https://github.com/discordeno/discordeno/compare/15.0.0...15.0.1
Published by Skillz4Killz about 2 years ago
ApplicationCommandOptionChoice
and invalid HTTP method in upserting commands. by @vxern in https://github.com/discordeno/discordeno/pull/2448
Full Changelog: https://github.com/discordeno/discordeno/compare/14.0.1...15.0.0
Published by Skillz4Killz about 2 years ago
/channels
) -> /channels/stages
/channels/followChannel.ts
-> /channels/announcements/followChannel.ts
/channels/updateVoiceState.ts
-> /guilds/updateVoiceState.ts
/channels/getPins.ts
-> /messages/getPins.ts
/guilds
) -> /guilds/voice
/guilds/scheduledEvents
-> /guilds/events
/guilds
) -> /guilds/widget
/integrations
-> /guilds/integrations
/interactions
+ /interactions/commands
) -> /interactions/responses
/invites/getChannelInvites.ts
-> /channels/getChannelInvites.ts
/invites
-> /guilds/invites
/messages
) -> /messages/reactions
/oauth/getApplicationInfo.ts
-> /misc/getApplicationInfo.ts
/voice
) -> /guilds/voice
In all functions: modify
-> edit
In all functions: update
-> edit
followChannel
-> followAnnouncementChannel
createForumPost
-> createForumThread
updateStageInstance
-> editStageInstance
addToThread
-> addThreadMember
deleteChannelOverwrite
-> deleteChannelPermissionOverride
editChannelOverwrite
-> editChannelPermissionOverrides
startTyping
-> triggerTypingIndicator
⭐swapChannels
-> editChannelPositions
⭐getPins
-> getPinnedMessages
publishMessage
-> crosspostMessage
⭐modifyRolePositions
-> editRolePositions
deleteAllReactions
-> deleteReactionsAll
deleteReactionEmoji
-> deleteReactionsEmoji
updateBotVoiceState
-> editOwnVoiceState
⭐updateUserVoiceState
-> editUserVoiceState
⭐editWidget
-> editWidgetSettings
getAuditLogs
-> getAuditLog
upsertGlobalApplicationCommand
-> editGlobalApplicationCommand
upsertGuildApplicationCommand
-> editGuildApplicationCommand
sendWebhookMessage
-> executeWebhook
⭐⭐ marks functions for which the old function name is available as an alias.
getArchivedThreads
->
getPublicArchivedThreads
getPrivateArchivedThreads
getPrivateJoinedArchivedThreads
createApplicationCommand
-> createGuildApplicationCommand
, createGlobalApplicationCommand
deleteApplicationCommand
^ and so on.getApplicationCommand
getApplicationCommands
upsertApplicationCommand
upsertApplicationCommands
*InteractionResponse
to *FollowupMessage
:
deleteInteractionResponse
-> deleteOriginalInteractionResponse
, deleteFollowupMessage
editInteractionResponse
^ and so on.getInteractionResponse
sendInteractionResponse
editWebhookMessage
-> editOriginalWebhookMessage
, editWebhookMessage
deleteReaction
-> deleteOwnReaction
, deleteUserReaction
/interactions/followups
(superceded by functions in /interactions/responses
)editBotNickname
(deprecated in the API, practically identical to editBotProfile
)memberId
was replaced with userId
.id
were updated to be more descriptive.data
) were renamed to options
.Full Changelog: https://github.com/discordeno/discordeno/compare/13.0.0...14.0.0
Published by Skillz4Killz about 2 years ago
Pure awesomeness!
Details at: https://discord.com/channels/785384884197392384/785406107912634399/1014578421050900540
CreateBotOptions.helpers
. by @norio-nomura in https://github.com/discordeno/discordeno/pull/1826
docs
folder has been renamed to site
by @itohatweb in https://github.com/discordeno/discordeno/pull/1986
editMessage
content length check by @TriForMine in https://github.com/discordeno/discordeno/pull/1993
deno fmt
by @itohatweb in https://github.com/discordeno/discordeno/pull/1992
configs.ts
by @itohatweb in https://github.com/discordeno/discordeno/pull/1995
communicationDisabledUntil
correctly by @itohatweb in https://github.com/discordeno/discordeno/pull/1999
Bot
by @itohatweb in https://github.com/discordeno/discordeno/pull/2002
createGatewayManager
to gateway module by @itohatweb in https://github.com/discordeno/discordeno/pull/2012
createRestManager
to rest module by @itohatweb in https://github.com/discordeno/discordeno/pull/2013
lf
line endings by @itohatweb in https://github.com/discordeno/discordeno/pull/2023
deno.json
by @itohatweb in https://github.com/discordeno/discordeno/pull/2022
value
to InputTextComponent
by @itohatweb in https://github.com/discordeno/discordeno/pull/2026
src/
by @Skillz4Killz in https://github.com/discordeno/discordeno/pull/2032
ws
folder to gateway
by @itohatweb in https://github.com/discordeno/discordeno/pull/2037
sendTextMessage
to send a simple string by @Skillz4Killz in https://github.com/discordeno/discordeno/pull/2033
MANAGE_GUILD
by @Skillz4Killz in https://github.com/discordeno/discordeno/pull/2034
fetchAndRetrieveMembers
by @Skillz4Killz in https://github.com/discordeno/discordeno/pull/2035
JsonErrorCodes
by @lts20050703 in https://github.com/discordeno/discordeno/pull/2038
JsonErrorCodes
by @lts20050703 in https://github.com/discordeno/discordeno/pull/2039
attachment
to InteractionData
by @lts20050703 in https://github.com/discordeno/discordeno/pull/2062
SelectOption#default
is not required by @itohatweb in https://github.com/discordeno/discordeno/pull/2066
Embed
to DiscordenoEmbed
by @lts20050703 in https://github.com/discordeno/discordeno/pull/2054
stopGateway
function by @AFink in https://github.com/discordeno/discordeno/pull/2078
image_hash
audit log change key by @itohatweb in https://github.com/discordeno/discordeno/pull/2142
premiumSubscriber
to RoleToggles
by @itohatweb in https://github.com/discordeno/discordeno/pull/2141
BigInt
call by @meister03 in https://github.com/discordeno/discordeno/pull/2217
createForumPosts
to createForumPost
by @lts20050703 in https://github.com/discordeno/discordeno/pull/2220
getArchivedThreads
before
option and wrong return type by @lts20050703 in https://github.com/discordeno/discordeno/pull/2222
required
optional for application command option interface by @Endy3032 in https://github.com/discordeno/discordeno/pull/2234
editApplicationCommandPermissions
by @itohatweb in https://github.com/discordeno/discordeno/pull/2238
sendInteractionResponse
file upload by @itohatweb in https://github.com/discordeno/discordeno/pull/2239
DiscordApplicationCommand
by @lts20050703 in https://github.com/discordeno/discordeno/pull/2291
Full Changelog: https://github.com/discordeno/discordeno/compare/12.0.1...13.0.0
Published by Skillz4Killz almost 3 years ago
This version was a big rewrite of the library that pushed the functional programming design even further. We removed almost every form of getter and a lot of OOP stuff in the library. On top of that, we made a bunch of minor improvements and fixes as well. We are now up to date with the latest changes on the discord-api-docs repo, as well as ready to support incoming features in the next month.
convention over configuration
to configuration over convention
. Previously everything was not configurable but it was defaulted to the best options possible. Now everything in the library is customizable without having to fork and modify and maintain a fork. Just plugin and override anything of your choosing.Published by itohatweb over 3 years ago
Published by Skillz4Killz almost 4 years ago
From breaking changes to small bug fixes to QoL improvements, this release has it all. This is Discordeno Next!
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.
Getters are introduced in Discordeno v10 as a QoL improvement.
import { sendMessage } from "discordeno";
await sendMessage("Channel ID", "Content");
...
message.send("Content");
This change is a breaking change, it increases consistency by enabling users to use consistent API throughout their code.
import { hasChannelPermissions, Permissions } from "discordeno";
await hasChannelPermissions(
"Channel ID",
"User ID",
[Permissions.MANAGE_MESSAGES]
);
import { hasChannelPermissions } from "discordeno";
await hasChannelPermissions("Channel ID", "User ID", ["MANAGE_MESSAGES"]);
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.
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."
import { startBot } from "discordeno";
startBot({
token: "BOT TOKEN",
intents: [1234567890]
});
// throws: "[Invalid intent(s)] Sent an invalid intent for a Gateway Intent."
import { startBigBrainBot } from "discordeno";
startBigBrainBot({
wsURL: "wss://my-custom-ws-url.com",
restURL: "https://my-custom-rest-url.com",
cdnURL: "https://my-custom-cdn-url.com",
});
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/[email protected]/mod.ts
Published by Skillz4Killz about 4 years ago
Version 9 is all about flexibility and customizability. It allows you to dig in and make Discordeno work exactly how you want it to. Had to do 9.0.1 because I had a silly mistake in forgetting to publish deps.ts to nest.land for the 9.0.0.
cleanMessageCache
interval internally to allow you a much better way to handle these. The new advanced caching features allow a much more granular control and therefore this function was no longer possible. To replace this, I have added a sweeper
task to the boilerplate so if you are using that, you can copy that file to your bot. This task will help clean out your cache for the most part so that your bot is optimized as much as possible_new
permission fields have been removed.roles
, nick
, premium_since
hasChannelPermission
for channelOverwriteHasPermission
.sendMessage
needed a Channel before. Now it only needs a channelID. The change was made to allow bots to be more stateless so that they can grow much larger without needing to rely on everything existing in cache.rate_limit_per_user
is now slowmode
Previous Errors:
error: Uncaught Error: REQUEST_CLIENT_ERROR
throw new Error(Errors.REQUEST_CLIENT_ERROR);
^
at handleStatusCode (requestManager.ts:314:13)
at Object.callback (requestManager.ts:233:9)
at async requestManager.ts:101:28
New Errors:
{
type: "error",
data: {
method: "patch",
url: "https://discord.com/api/v8/guilds/223909216866402304/members/130136895395987456",
body: { nick: "test" },
retryCount: 0,
bucketID: undefined,
errorStack: Error: Location In Your Files:
at runMethod (requestManager.ts:201:9)
at Object.patch (requestManager.ts:133:12)
at editMember (member.ts:185:25)
at Object.messageCreate (debug.ts:36:9)
at Object.handleInternalMessageCreate [as MESSAGE_CREATE] (messages.ts:50:32)
}
}
This guide is for everything below:
https://discordeno.mod.land/advanced/customizations
Note this is meant for advanced developers. Do not use this if you are not advanced enough. Powerful but dangerous. With great power comes great bugs!
Controllers are one of the most powerful features of Discordeno. They allow you to take control of how Discordeno handles the Discord payloads from the gateway. When an event comes in, you can override and control how you want it to work. For example, if your bot does not use emojis at all, you could simply just take control over the GUILD_EMOJIS_UPDATE event and prevent anyone from caching any emojis at all. Another example, is if you are building a custom module/framework around Discordeno and you want to provide more custom events such as when someone boosts the server or some other custom event this is possible as well.
Discordeno provides the ability to customize structures. You have the ability to override the function that creates the structures inside Discordeno. THIS DOES NOT MODIFY THE PROTOTYPE! I wanted to make sure that Discordeno handled this without encouraging bad practices such as prototype pollution which can make your bots inherintly unstable and unpredictable. Discordeno allows you to take control over the functions that create the structures. In fact, if u really wanted to get fancy you could even return entire classes inside that function and the member could become a class if u want.
One of the features that Discordeno has is the ability to customize the cache. In order to do this, we will simply override the cache handlers. For example, you could use Redis caching if you like. Using this, you will be able to control where your cache is stored, how its handled and much more.
Published by Skillz4Killz about 4 years ago
ATTENTION: If you have not already please join the Discord server for the latest updates. I actively keep the Discord server updated with all relevant information. Get update alerts and much more faster on discord!
This is a summary of all the updates made in the last 10 days. Enjoy 🎉
v8.3.0 - Intergalactic Encylopedia Salesman :g4m3rhug:
Added
removeUserReaction
- Remove another users reactiongetChannel
- Fetches a single channel object from the api.getMembersByQuery
- Returns guild member objects for the specified user by their nickname/username.getWebhook
Gets a webhook with the webhook id.Fixed:
any
instead of the value of the collection.Changed
getChannels
now returns proper Channel objects instead of raw payload. It also caches the objects by default but you can disable it.Guide Updates:
Discordeno has one of the coolest ways to create commands for advanced level developers. I call it Dynamic command creation. This allows you to basically create a bunch of commands that are similar instantly.
This is some advanced level super magical command creation skills. Discordeno gives you the power to dynamically create commands. What that means is you can write the code for one command but dynamically create like 50 commands using that same code.
v8.3.1
The reaction functions no longer require users to properly string emojis. The library will now handle it for you.
Previously you had to change an emoji from <:g4m3rhug:458994471712063499> to name:ID however, now we will do it for you making it even easier for you to code your bots.
User Experience is everything!!!
v8.4.1
Fixed
Added:
followChannel()
Use this to follow news channels. Very useful for allowing you to have server owners/admins subscribe to your bot's support news channels.publishMessage()
Automatically publish a message in a news channel to all servers following that channel.Guide:
Published by Skillz4Killz about 4 years ago
Changed
/integrations?include_applications=true
added query option to get back bots in integrations query.Added
Fixed
Published by Skillz4Killz about 4 years ago
Added
createWebhook()
create a webhookexecuteWebhook()
execute a webhook to send messages or multiple embeds.Published by Skillz4Killz about 4 years ago
We will be jumping a couple version in minor in order to get nest.land tested and worked. P.S. We should now be on nest.land 🎉
Fixed:
Added:
memberHasPermission
and use this new function instead.addReactions()
function to add multiple reactionsrequestManagerFetching
type on debug event.Changed: