Commit Graph

74 Commits

Author SHA1 Message Date
Skillz4Killz
7400d6985f Merge pull request #771 from itohatweb/fix-idk
fix: missing type imports
2021-04-08 09:52:41 -04:00
Skillz4Killz
1fdf377daf Merge pull request #753 from itohatweb/perm-check-only-if-cached
fix(util/permissions): only check for permission if channel is cached
2021-04-08 09:52:23 -04:00
ITOH
313e7d2d35 fir more things 2021-04-07 10:27:44 +02:00
Skillz4Killz
47ed6f5652 fix: remove basicShards and allowNextShard (#755) 2021-04-05 09:37:25 +04:00
ITOH
286aea4631 Merge remote-tracking branch 'upstream/main' into perm-check-only-if-cached 2021-04-04 18:44:38 +02:00
ITOH
2bd0841bb2 that 2021-04-04 17:19:48 +02:00
ITOH
a455b753d7 rere 2021-04-04 17:18:04 +02:00
Skillz4Killz
57540567a5 chore: removes random util (#752) 2021-04-04 18:59:22 +04:00
Skillz4Killz
1b8161e85b refactor: cleanup and fmt 2021-04-04 12:54:33 +00:00
Skillz4Killz
181bdffb41 Merge branch 'main' of https://github.com/discordeno/discordeno into proxy-ws 2021-04-04 12:28:39 +00:00
Skillz4Killz
5d3b01b3e7 fix: typings names & imports 2021-04-04 12:21:30 +00:00
Skillz4Killz
7ea1f7adce Merge branch 'main' into message-channel-mentions 2021-04-03 23:39:01 -04:00
Skillz4Killz
210f89ec4e fix: channel mentions includes all valid mentions 2021-04-04 03:23:26 +00:00
Skillz4Killz
b81bf8d484 chore: deno fmt 2021-04-04 00:34:40 +00:00
Skillz4Killz
408120c508 fix: bunch of imports that were missing 2021-04-03 23:30:48 +00:00
ayntee
6aa9b25698 refactor(structures/channel): auto-convert the paylaod fields to camel case (#730) 2021-04-02 23:21:13 +04:00
ayntee
5f1b82a4e8 refactor: remove RequestManager and use runMethod() (#732)
* fix(rest/process_request): use DiscordHTTPResponseCodes

* refactor: remove RequestManager

* refactor: remove RequestManager and use runMethod()
2021-04-02 23:18:51 +04:00
ayntee
8de973f650 chore: use DiscordBitwisePermissionFlags and PermissionStrings 2021-03-29 23:57:06 +04:00
ayntee
b0c3398689 fix(util/utils): remove ID handling from case manipulation functions 2021-03-29 21:07:36 +04:00
ayntee
eaff54f90f refactor: rename *ID to *Id (#710)
* refactor: rename *ID to *Id

* Update src/helpers/commands/delete_slash_command.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/commands/delete_slash_command.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/commands/delete_slash_response.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/commands/edit_slash_response.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/utils.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/utils.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/utils.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/utils.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/utils.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/commands/get_slash_command.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/commands/send_interaction_response.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/commands/upsert_slash_command.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/guilds/edit_widget.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/guilds/get_widget.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/guilds/get_widget.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/guilds/get_widget_image_url.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/guilds/get_widget_image_url.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/guilds/get_widget_settings.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update .gitignore

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update LICENSE

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/members/edit_bot_profile.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/members/edit_bot_profile.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/webhooks/create_webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/webhooks/delete_webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/constants.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/webhooks/edit_webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/webhooks/execute_webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/webhooks/get_webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/rest/cache.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/rest/request.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/constants.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/commands/delete_slash_response.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/constants.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/constants.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/constants.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/constants.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/utils.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/utils.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Revert docs file

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>
2021-03-29 21:03:46 +04:00
ITOH
2914874d19 types: add gateway opcodes enum (#711)
* bring opcodes enum back

* Update src/types/gateway/opcodes.ts

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

* DiscordGatewayOpcodes

Co-authored-by: ayntee <ayyantee@gmail.com>
2021-03-29 20:58:33 +04:00
ITOH
89e4b1eacd fix(util/utils): fix logic error in validateSlashOptions() (#699) 2021-03-28 20:22:42 +04:00
ITOH
c91c9d0870 types: remove entire types (#684) 2021-03-23 19:14:26 +04:00
ayntee
6ff4654686 refactor(util): remove chooseRandom() (#682) 2021-03-23 16:47:46 +04:00
ayntee
c1a016ca9f fix(util/collection): .first(), .last(), .random() may return undefined (#680)
* fix(util/collection): .first() may return undefined

* fix(util/collection): .random(), .last() may return undefined
2021-03-23 14:31:29 +04:00
ayntee
5125ffd308 refactor: replace util/cache with cache 2021-03-20 10:06:57 +04:00
ayntee
e9cbbbff7c refactor(helpers): separate functions into files (#667)
* refactor(helpers): separate functions into files

* idk

* idk
2021-03-13 08:10:31 -05:00
ITOH
88ce4da555 fix(utils/permissions): use |= operator for role deny overwrite in calculateChannelOverwrites() (#665) 2021-03-12 15:27:39 +04:00
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
ayntee
8654aeded5 refactor: rename controllers to handlers and handlers to helpers (#660)
* refactor: rename controllers to handlers and handlers to helpers

* fmt
2021-03-11 21:41:03 +04:00
ayntee
aaed064709 refactor(controllers): separate controllers into different files (#657)
* refactor(controllers): separate controller into files

* add CHANNEL_UPDATE

* guilds

* interactions

* members

* messages

* finally

* done

* fix ci

* fixes
2021-03-11 20:38:27 +04:00
ayntee
45a3246370 fix(ws/shard): update status update payload (#559)
* fix(ws/shard): update status update payload

* :(

* Update src/types/discord.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* it\'s activitypayload

* Update src/types/discord.ts

* idk

* idk

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>
2021-03-08 19:41:20 +04:00
ITOH
25858b3144 feat(util): add camelToSnakeCase() & snakeToCamelCase() (#615)
* feat(util): add to camel/snake case functions

* add tests

* hmm

* add lint ignore comment

Co-authored-by: ayntee <ayyantee@gmail.com>
2021-03-07 18:51:59 +04:00
ayntee
4af6f363f8 feat(handlers/webhook): test slash command name against ^[\w-]{1,32}$ (#613)
* feat(handlers/webhook): test slash command name against ^[\w-]{1,32}$

* Update src/api/handlers/webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/api/handlers/webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/api/handlers/webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/api/handlers/webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* move to constants file

* idk

* idk

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>
2021-03-07 18:48:12 +04:00
ayntee
7a52f301b3 fix(util/permissions): move owner check before member cache check (#555) 2021-02-27 23:54:37 +04:00
Skillz
f1d4f35e46 moves random function 2021-02-25 15:28:49 -05:00
ayntee
2fc067b26d Revert "feat(handlers): add Membership Screening" (#490)
* Revert "feat(handlers): add Membership Screening (#449)"

This reverts commit 6599636dbc.

* Remove type definitions
2021-01-30 15:23:29 +04:00
ayntee
79089d239b fix(util/permissions): include guild ID while resolving bits (#481)
Closes #480
2021-01-28 13:58:24 +04:00
Ayyan
6599636dbc feat(handlers): add Membership Screening (#449)
* feat(handlers): support membership screening feature

* s
2021-01-26 19:20:06 +04:00
ayntee
683900236f Remove tests 2021-01-26 13:16:53 +04:00
ITOH
95a2b7a74d feat(util): add camelToSnakeCase() & snakeToCamelCase() (#473)
* Update utils.ts

* add tests

* Update utils.test.ts

* void unnecessary

* Apply suggestions from code review

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

* Update src/util/utils.ts

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

* Update utils.ts

* remove object test

* some name changes

Co-authored-by: Ayyan <ayyantee@gmail.com>
2021-01-26 12:44:25 +04:00
Ayyan
17959bc1c8 Revert "feat(util): add camelToSnakeCase() & snakeToCamelCase() (#463)" (#469)
This reverts commit 08d685743a.
2021-01-26 10:51:36 +04:00
ITOH
08d685743a feat(util): add camelToSnakeCase() & snakeToCamelCase() (#463)
* Update utils.ts

* add tests

* Update utils.test.ts

* void unnecessary

* Apply suggestions from code review

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

* Update src/util/utils.ts

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

* Update utils.ts

* remove object test

* some name changes

Co-authored-by: Ayyan <ayyantee@gmail.com>
2021-01-26 10:45:30 +04:00
ITOH
ce33790d97 fix(util): use custom cache instead of default cache (#461)
* Update permissions.ts

* fixe that
2021-01-25 17:24:33 +04:00
ayntee
e455ba1655 Revert "refactor(util): use getter instead (#432)"
This reverts commit 8d5803c82a.
2021-01-25 15:09:02 +04:00
ITOH
51387c5705 refactor(util): COMMANDS_GUILD_ID constant arg order (#440)
* fmt

* refactor(util): change arg order for COMMANDS_GUILD_ID

* refactor(handlers): change arg order for COMMANDS_GUILD_ID

* feat(handlers): add getSlashCommand function

* Update mod.ts

* remove that
2021-01-24 15:12:40 +04:00
ITOH
c281665961 fix: use applicationID for slash commands instead of botID (#437)
* add(bot): ApplicationID let & setApplicationID function

* fix(controllers): set application id when bot is ready

* refactor(util): rename botID argument to applicationID

* fix(handlers): use applicationID
2021-01-23 23:19:12 +04:00
ITOH
f6f435bb1f feat(handlers): add getAvailableVoiceRegions() (#425)
* add voice endpoint

* feat(handlers): add getVoiceRegions

* Update mod.ts

* remove breaking changes
2021-01-23 23:17:11 +04:00
ITOH
f70a989a21 types: better types (#413)
* Update cache.ts

* Update shard_manager.ts
2021-01-23 23:15:11 +04:00
ITOH
8beb036741 feat(handlers): add getGatewayBot() & getApplicationInformation() (#428)
* feat(handlers): add getGatewayBot()

* refactor(bot): use getGatewayBot() to get gateway data

* feat(handlers): add getApplicationInformation

* add(handlers): getApplicationInformation jsdoc

* Add oauth required types

* create separate file

* delete misc

* OAuthApplication

* forgot to update import

* idk why that was here
2021-01-23 14:51:35 +04:00