discordeno

Discord API library for Node and Deno

APACHE-2.0 License

Downloads
14.7K
Stars
784
Committers
89

Bot releases are hidden (Show)

discordeno - v7.0.1: Open The Iris!

Published by Skillz4Killz about 4 years ago

  • Fixes couples bugs related to mod.ts file missing src/ in its paths.
discordeno - v7: General Hammond

Published by Skillz4Killz about 4 years ago

Changed:

  • A lot of leftover hidden snake cases have been changed.
  • Update npm deps for the docs
  • Move all folders except docs into the src folder to improve support for deno extension as it now has enabled option merged in its latest version. So it can fmt/lint specific folders and no longer have issues fmt or linting docs folder.
  • Refactored a lot of functions that required full objects. For example:
    kick(guild: Guild, memberID: string, reason?: string) now is kick(guildID: string, memberID.......) closes #61

Added:

  • Add oldPresence to presenceUpdate event #79
  • Export Collection in mod.ts
  • rawGateway event handler is available to listen to Gateway events like InvalidSession or Reconnect.
  • raw even will be those that is a discord event your bot would listen to.
  • More debug logs added for you to be able to see more things of what is happening internally.
  • Big Int Supported Closes #78
  • Added permission handling for sending embeds
  • Added isReady property to the cache object to alert when the bot is FULLY ready.
  • GuildCreate will no longer be called on all guilds when bot restarts. guildLoaded(guild) is the new event handler for every single guild ur bot is on on bootup. GuildCreate is only for guilds that are added after ur bot is online.

Fixed:

  • Better Reconnect handling implemented.
  • Fixed a small bug where on occasion it would heartbeat twice after resume.
  • Fixed a small bug that would cause heartbeat to be slow by 45 seconds.
  • Fixed a small bug that caused an extra resume when it was already resumed
  • Fixed TTS send message bug that broke because of channel.guildID typo instead of channel.id
discordeno - v6.2.0: First Prime

Published by Skillz4Killz about 4 years ago

Fixed

  • Fixed a permission bug that was not allowing some functionality when one of the roles allowed a perm but another role disallowed it. This will now force allowed to override.
  • Fixed voice events bugs showing invalid events due to cache bug showed in #74
  • Fixed a bug that prevented the channel from creating when providing a type. This will now properly convert the type you provide to what Discord expects. #70

Added

  • Removes the voice state when a user leaves a channel
  • deleteChannel() deletes a channel of your choosing.
  • Basic sharding explained in detail in #68
  • Internal base64 conversion for most URLs. For example, you can now just provide a simple URL for editing a server icon or emoji upload.

Changed

  • Updated std to 0.61.0 as Deno 1.2 was a breaking(YAY SEMVER!) change and requires the latest std.
discordeno - v6.1.2 Tek Ma Te

Published by Skillz4Killz over 4 years ago

  • Fixed the get requests with body params. Get requests body are now moved as part of the query string instead
discordeno - v6.1.1: Jaffa Cree

Published by Skillz4Killz over 4 years ago

  • Small fix to change emoji URL to png instead of jpg
discordeno - v6: Indeed

Published by Skillz4Killz over 4 years ago

  • Add the ability to change API version on the fly. Forgot this commit in 6.0 release 🤦
discordeno - v6: Teal'c

Published by Skillz4Killz over 4 years ago

  • Support for allowing or suppressing mentions in a message.
  • self_video prop on voice
  • embed => widget. Discord has deprecated the old embed props on guild.
  • Support roles prop on prune methods. This will let you prune members with certain role ids. BREAKING
  • Discord changed delete-message-days to delete_message_days. This will now use days to not be a breaking change in the future. BREAKING
  • emojiURL(id, animated) new helper function available for getting the emoji url from discord cdn
  • Support uploading files
  • Added changeAPIVersion(number) to allow dynamically changing API versions on the fly without needing to restart your bot.
discordeno - v5.1.1: Better Errors,

Published by Skillz4Killz over 4 years ago

  • Bumps the API version internally to v7 to get more detailed and useful errors, since Discord officially endorsed the usage of v7 now.

  • Fixed a bug in Channel Permission handling. Critical bug fix!

  • Fixed a bug that prevented creating roles.

  • Added some more details to console logs when a CLIENT_REQUEST_ERROR is thrown. This will help you better debug where the issue comes from.

discordeno - v5.1.0: getMember & Channel Editing Enhancements

Published by Skillz4Killz over 4 years ago

  • Improved documentation and readme example to latest version.

Added

  • getMember() now will return a full Member type which will add some functionality and cache the member.

Fixed:

  • Channel editing bug has been patched. It will now calculate the bits internally when you pass it a string of permissions to edit.
discordeno - v5: Samantha Carter

Published by Skillz4Killz over 4 years ago

This version was heavily focused on improving cache/memory needs to be able to allow bigger bots using this library.

  • Removed botID from client options. Instead, lib gets the botID from the READY event.
  • fixed some payload typings where it was labelled as entire Member object instead of the proper Member Payload.
  • All structures have had their methods removed and moved to separate handlers. This helped drop a lot of RAM usage. Instead of every single object having their own methods, now we just simply have 1 method available. This is crucial for allowing bots to grow bigger as once they have a lot of members this can start costing $$$.
  • Some structures had quite a bit of redundant properties with snake case format. Those properties have been removed from the interface so they do not come up in VSC as you code anymore.
  • Properly supports the new channel name/topic editing rate limiting.

Removed:

  • updateChannelCache was an internal function but was exposed publically. This function has been removed entirely.

Added

  • Collection class was added at request of users to make it easier to use methods on Maps.
  • maxSize property on Collection can be used to prevent anything from caching. For example, if you don't care about caching members just set the members cache to maxSize = 0
  • Cleaner logger exports so you can do logger.error() instead of logRed()
    • logger.success()
    • logger.info()
    • logger.error()
    • logger.warn()
  • Delete relevant cached messages when guild is deleted or when a channel is deleted.
  • Message cache will sweep every minute deleting oldest messages in every channel only if that channel has more than 100 messages. Having too many messages allowed RAM to be taken up unlimited amount.
  • Debug event handler to listen to logs from the library internal code.
discordeno - v4.0.1: Bug Fixes

Published by Skillz4Killz over 4 years ago

  • fix: Message.mentions was really annoying to support and handle. The typings were being caused by an option that would never be allowed to exist anyway. Discord doesn't send users in the mentions array if its not a valid member.
  • fix: Fixed the voice state bugs reported in #51
  • fix: Fixed the image url formatting types. The order of operations was making it so it could never be anything but gif or jpg. This should now allow all types
discordeno - v4: The Daniel Jackson

Published by Skillz4Killz over 4 years ago

  • Updated the API URL to change to the new Discord.com instead of Discordapp.com
  • The User structure and the user's cache were taking up a ton of memory but it was entirely duplicate data. All of the data for any user is also stored in the Member objects. There is never a user who does not have a guild member object. The entire concept of a User has been removed. This allowed 1.5 million-member objects plus all other caches to be handled with <300MB compared to the 1+GB before. The necessary user functions like sendMessage have been moved over to the member.
  • GuildBanAdd and GuildBanRemove, GuildMemberRemove will now try and return a Member object if available or opted for the user properties.
  • Removed unused properties from the queue system when fetching members.
  • Refactored and cleaned up RequestAllMembers
  • Message.mentions will now provide the Member or the UserData if member wasnt found.

Added:

  • Added messageUpdate event for when messages are edited.

Fixed:

  • Queue system for the Gateway rate limiter. Rate limits will be handled now for the gateway commands such as fetch members. Tested 6000+ calls at once.
  • GUILD_CREATE was firing off multiple times when shards were Resuming.
  • If a Member data is provided by Discord on Voice payloads, we can create the member instead of canceling out.
  • Fetching all members from all guilds is now possible.
discordeno - v3: O'Neill With 2 L's

Published by Skillz4Killz over 4 years ago

  • refactor: All types of Member, Guild, User, Role, Message, Channel have been converted into Interfaces.
  • refactor: createMember() to remove 2 unnecessary parameters.
  • refactor: memberHasPermission() performance enhanced.
  • refactor: Get users from cache instead of creating a new user on each message. The same for all users that were mentioned.
  • enhance: Cache all users on member creation.
  • refactor: Removed all raw properties. This was eating up memory as duplicate values were being stored. Raw was used for pre-spread. The spread operator makes raw useless.
  • Updated Guild object typings for Discord API Docs

Added

  • channel.hasPermission(id, [perms]) Check if a user or role has permission in said channel.
  • guildID prop on member
  • guild() on member to get the guild for this member. A method, to preserve memory.
  • Permission Handler added for trying to delete messages.
  • message.guild() to access the guild property.
  • message.member() to access the member for the message author.
  • user.sendMessage() can now send messages to users dm.

Fixed

  • Cache members when they are mentioned in messages.
  • Fixed channel.guildID consistently when available. Guild ID was missing on channels when they were created during GUILD_CREATE. For some reason, discord does not pass the guild_id property on GUILD_CREATE.
  • On invalid session websocket disconnects, we now check the d payload prop to determine whether to resume or identify again.
  • Sharding now works properly for as many shards as needed. Tested up to 6 shards.
  • Fixed an error on GUILD_ROLE_DELETE payload handling.
  • Fixed an error on GUILD_UPDATE payload handling. The guildUpdate event will no longer pass a full guild as the cached guild. Instead it will be guildUpdate(guild, changes) The changes will be an array with the following format:
[
 { key: "string", oldValue: "unknown", value: "unknown"
]
  • Fixed fetching all members on every guild. Rate limit properly handled. Tested up to 1 million+ members fetched.
discordeno - v2: Remove Snake Case And Better Permission Checking

Published by Skillz4Killz over 4 years ago

First Official Release Through Github Tags/Releases.