ITOH ebbcd762cf feat(util/permissions): improve permission-checking (#381)
* Update permissions.ts

* add(permissions): explaining comments

Since Discord permissions are quiet complex  it is better to have detailed comments explaining everything.

* docs: add better permissions jsdoc comments

* types: add missing errors

* change imports

* we want a string here

* strange commit here

* we need an s in tts

* permissions: update channel permission handling

* permissions: update guild permission handling

* permissions: update member permission handling

* permissions: update message permission handling

* permissions: update webhook permission handling

* fix this buggg

* fix: typo

* better func names

* better description

* permissions(editMember): add permission check if channel_id is provided

* added todo for deaf

* fixxx

* FIIIXXX

* Update permissions.ts

* throwOn to require

* change up review things

* Update src/util/permissions.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>

* Update src/util/permissions.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>

* Update src/util/permissions.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>

* Update src/util/permissions.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>

* Update src/util/permissions.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>

* Apply suggestions from code review

Co-authored-by: Ayyan <ayyantee@gmail.com>

* BigInt() to n

* Update src/util/permissions.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>

* Update src/util/permissions.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>

* Update src/util/permissions.ts

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>

* missed this

* Update permissions.ts

* here enum is needed

* use set so errors arenn't strange

* dumb idea

* hasChannelPermissions functions are nice to have

* role to guild

* bugg

* fix(handlers): createGuildChannel check overwrite perms

* remove redundant if check

* fixes

* Update guild.ts

* bettrrrr

* Revert "bettrrrr"

This reverts commit ecbd30e160.

* I hate it

* fix fix

* fixxesss

* this function is better

* oh forgot these

* better I guess

* more functions

* silly me forgot to remove console.logs

* buuuuugs

* small changes

* Update permission.ts

* Update permissions.ts

* Update GUILD_CREATE.ts

* Update channel.ts

* remove this

* suggestions

Co-authored-by: Ayyan <ayyantee@gmail.com>
Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2021-03-11 22:33:52 +04:00
2021-03-11 21:57:34 +04:00
2021-03-03 14:07:57 +04:00
2021-03-11 17:46:06 +04:00
2021-03-11 17:46:06 +04:00
2021-02-25 22:10:54 +04:00

Discordeno

Discord API library for Deno

Discordeno follows Semantic Versioning

Discord Lint Test

Table of contents

Features

  • Secure & stable: Discordeno is actively maintained to ensure great performance and convenience. Moreover, it internally checks all missing permissions before forwarding a request to the Discord API so that the client does not get globally-banned by Discord.
  • Simple, Efficient, & Lightweight: Discordeno is simplistic, easy-to-use, versatile while being efficient and lightweight. Follows Convention Over Configuration design paradigm ― prefers defaults options or values that are recommended by Discord or the best configuration for the majority of the users.
  • Functional API: Functional API ensures an overall concise yet performant code while removing the difficulties of extending built-in classes and inheritance.

Getting Started

Minimal Example

Here is a minimal example to get started with:

import { startBot } from "https://deno.land/x/discordeno/mod.ts";

startBot({
  token: "BOT TOKEN",
  intents: ["GUILDS", "GUILD_MESSAGES"],
  eventHandlers: {
    ready() {
      console.log("Successfully connected to gateway");
    },
    messageCreate(message) {
      if (message.content === "ping") {
        message.reply("Pong using Discordeno!");
      }
    },
  },
});

Boilerplates

Note to developers: don't worry a lot of developers start out programming a Discord bot as their first project (I did 😉) and it is not so easy to do so. Discordeno is designed and built considering all the issues that I and a lot of developers had when I first started out coding Discord bots with existing libraries. If you are a beginner, you can check out these awesome official and unofficial boilerplates:

Contributing

We appreciate your help! Before contributing, please read the Contributing Guide.

Languages
TypeScript 98%
MDX 0.7%
CSS 0.6%
JavaScript 0.6%
Dockerfile 0.1%