Commit Graph

72 Commits

Author SHA1 Message Date
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 2c14a3f6b0 feat(handlers/message): change getReactions() to use collection (#655)
* feat(handlers/message): change getReactions() to use collection

* deno fmt
2021-03-11 18:01:21 +04:00
ayntee 724f09b4f7 refactor(handlers/guild): rename roles option to includeRoles (#654) 2021-03-10 20:27:12 +04:00
ITOH 4adf11b7b7 feat(handlers/guild): add getWidget() & getWidgetImageUrl() (#420)
* feat(handlers): more get Widget functoins

* forgot image jsdoc

* only needed inside if

* Update mod.ts

* move inside if

* gonna do that

* Update src/api/handlers/guild.ts

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

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2021-03-08 20:41:46 +04:00
ITOH 0ec33b7420 feat(handlers/webhook): change getSlashCommands() to return Collection (#410)
* refactor(handlers): getSlashCommands return Collection

* wrongy wrong
2021-03-08 20:39:40 +04:00
ITOH 2c3692810d refactor(structures): rename create* functions (#395)
* structures: rename structure create functions

* fix: errors occured because of structure rename

* fix(controllers): errors occured because of structure rename

* fix

* fix createServer to createGuild rename

* rename create*structure to create*Struct

* update docs

* Phew

* rename createguildrole

* fix that

* fmt?

* idk

* why

* fixxess

* Update member.ts

* Update member.ts

* ahh found it

* revert this

* Update mod.ts

Co-authored-by: ayntee <ayyantee@gmail.com>
2021-03-08 20:37:06 +04:00
ayntee 03d6614758 refactor: rename slowmode to rateLimitPerUser (#645) 2021-03-08 19:10:19 +04:00
Skillz4Killz 3a249d91d4 Revert "Revert "fix(handlers/webhook): return Message object instead of raw payload (#611)" (#634)" (#643)
This reverts commit a515765abf.
2021-03-08 18:52:59 +04:00
ITOH 42c743421b refactor(handlers/guild): rename guild widget functions (#386)
* Update guild.ts

* Update guild.ts

* this should be named getWidgetSettings

* update mod imports
2021-03-08 18:51:12 +04:00
ITOH ebc48156aa feat(handlers/guild): change createGuildChannel() to use guild ID (#528)
* guild > guildID

* fix(test): createGuildChannel test

* Update test/mod.test.ts

* Update test/mod.test.ts

* fmt

Co-authored-by: ayntee <ayyantee@gmail.com>
2021-03-08 18:23:04 +04:00
ayntee 95ac54cee9 fix(handlers/member): change editMember() to return a Member object (#578) 2021-03-08 18:13:27 +04:00
ayntee fdab0d93ba feat: change Guild.emojis to use collection (#388)
* feat(guild): change Guild.emojis to use collection

* idk
2021-03-08 18:13:01 +04:00
ITOH 100f7ff965 fix(handlers/channel): add permission handler for startTyping() (#626)
* add perm check

* Update src/api/handlers/channel.ts

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

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2021-03-08 17:46:23 +04:00
Skillz4Killz 5be674e3e8 feat(types/message): add fail_if_not_exists to Reference interface (#642)
* support fail replies

* fmt

* fix linter issue

* fix condition
2021-03-08 17:41:31 +04:00
ayntee a515765abf Revert "fix(handlers/webhook): return Message object instead of raw payload (#611)" (#634)
This reverts commit 9c7340f624.
2021-03-08 15:42:51 +04:00
ayntee 537d508cfa feat(types/guild): add computePruneCount to PruneOptions (#605)
* fix(handlers/guild): rewrite and rename pruneMembers()

* remove breaking change

* Update src/api/handlers/guild.ts

* Update src/types/guild.ts

* Update src/types/guild.ts

* Update src/types/guild.ts

* Update src/api/handlers/guild.ts

* Update src/api/handlers/guild.ts

* Update src/api/handlers/guild.ts

* Update src/types/guild.ts

* Update src/types/guild.ts

* Update src/types/guild.ts

* Update src/api/handlers/guild.ts

* Update src/api/handlers/guild.ts

* Update src/api/handlers/guild.ts

* fmt

* fixes

* Update src/types/guild.ts

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

* fmt

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2021-03-07 21:30:33 +04:00
ITOH e21a86d497 fix(handlers/webhook): handle slash commands limitations (#618)
* add more errors

* add the validation functions

* spread
2021-03-07 20:28:23 +04:00
ITOH 68bb2bc7a3 Merge remote-tracking branch 'upstream/main' into fix-upsert-slash-typings 2021-03-07 15:52:37 +01: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
ITOH b095b995ec fix upsertSlashCommand & upsertSlashCommands 2021-03-07 15:46:08 +01:00
Skillz4Killz 9c7340f624 fix(handlers/webhook): return Message object instead of raw payload (#611)
* fix: change any to message types

* Update webhook.ts

* Update src/api/handlers/webhook.ts

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

Co-authored-by: ayntee <ayyantee@gmail.com>
Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>
2021-03-07 18:39:19 +04:00
ITOH c319ca66cd feat(handlers/message): add options to getReactions (#607) 2021-03-07 11:55:18 +04:00
Skillz4Killz d084c3f3c4 fix(handlers/channel): handle max_age and max_uses limit in createInvite() (#597)
* fix: handle invalid invite create limits

* refactor: cleanup conditonals

* chore: clarification

Co-authored-by: ayntee <ayyantee@gmail.com>
2021-03-06 23:44:31 +04:00
Skillz4Killz e5bf5cd47c feat(handlers/webhook): support ephemeral messages (#602)
Co-authored-by: ayntee <ayyantee@gmail.com>
2021-03-06 22:59:45 +04:00
ayntee d8f3674779 fix(handlers/webhook): do not add Date.now() to 900000 ms in executeSlashCommand() (#601)
Related #589
2021-03-06 22:17:04 +04:00
Skillz 6eca60777c itoh is love itoh is bae this is his stuff 2021-02-22 12:01:32 -05:00
Skillz4Killz f481962b9c fix(handlers/channel): rewrite permission handler for send*Message() (#535)
* v8 stopped sending this

* better safety handling

* husky o husky where art though husky
2021-02-21 21:21:56 +04:00
TriForMine 602a74591e refactor: resolve promises (#515)
* Adding missing await and updating some deps

* Adding missing await and updating some deps

* Adding missing await and updating some deps

* Fix close code 4009 until deno fixes the issue: https://github.com/denoland/deno/pull/8776

* Fix heartbeating

* Add await for the requestGuildMembers in requestAllMembers

* Change body && body.file to body?.file

* Fix lint #1

* Change body && body.file to body?.file

* Fix lint

* Deno lint

* Update request.ts

* Fix deno lint error

* Update src/ws/shard_manager.ts

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

* Fix fetchMembers

* Fix getMembersByQuery

* Try to fix RequestMembersQueue processing

* Deno lint

* Fix requestGuildMembers

* Fix requestGuildMembers

* Fix requestAllMembers

* Undo useless changes

* Fix merge conflict

* Fix merge conflict

* Change for loop to Promise.all

* Deno fmt

Co-authored-by: ayntee <ayyantee@gmail.com>
Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2021-02-15 11:19:45 +04:00
ayntee ce99dc3e0a fix: remove structure automatic caching (#517)
* fix: remove structure automatic caching

* Update src/api/controllers/interactions.ts

* Update src/api/controllers/interactions.ts

* Update src/api/controllers/interactions.ts

* memb -> member

* rename shit

* Update src/api/controllers/misc.ts

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

* idk

* Update src/api/handlers/guild.ts

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

* fmt

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>
2021-02-12 22:18:05 +04: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
ITOH c3d7235918 feat(handlers): add getMembers() (#412)
* Update guild.ts

* add types

* forgot to import

* review things

* Update mod.ts

* Apply suggestions from code review

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

* remove redundant code

* Update guild.ts

* Paginate

* remove extra ()

* dont log if limit is < 1000

* thats unnecessary too

* Update guild.ts

* add sugg

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2021-01-27 18:57:49 +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
Ayyan 0fd258d834 Attempt to fix CI (#470) 2021-01-26 11:47:41 +04:00
ITOH 7c3743e024 refactor(handlers): resolve RequestManager.<method> using await before returning the value (#468)
* Update channel.ts

* Update gateway.ts

* Update guild.ts

* Update member.ts

* Update message.ts

* Update oauth.ts

* Update webhook.ts

* move things arrouond

* Update guild.ts

* Update src/api/handlers/webhook.ts

* stop linter complains

* add this back

Co-authored-by: Ayyan <ayyantee@gmail.com>
2021-01-26 11:43:45 +04:00
ITOH 36294b5451 fix(handlers): add editSlashResponse() (#399)
* update: editSlashResponse

* remove breaking changes
2021-01-25 19:09:48 +04:00
ITOH b7557050a6 feat(handlers): add editWebhook*(), deleteWebhook*(), getWebhook*() (#438)
* feat(handlers): add getWebhookWithToken

* Update webhook.ts

* remove(utils): dry constants

* feat(handlers): add more webhook functions

* move functions arround

* well that function is not needed

* better return types

* Apply suggestions from code review

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

Co-authored-by: Ayyan <ayyantee@gmail.com>
2021-01-24 23:57:27 +04:00
ITOH 1c6d5a60e0 feat(handlers): add upsertSlashCommands() (#442)
* feat(handlers): add bulk upsert commands function

* Update mod.ts

* add jsdoc

* add ID info

* ID is optional

* Update webhook.ts

* use //@ts-ignore

* idk
2021-01-24 22:41:28 +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 e952d1d9cb feat(handlers): add getSlashCommand() (#444) 2021-01-24 14:55:09 +04:00
ITOH fada547388 fix(handlers): edit/upsertSlashCommand function (#441)
* fix(handlers): editSlashCommand function

* this check is needed

* fix(handlers): upsertSlashCommand function

* fmt

* add deprecated note

* up

* full use of options

* after thinking it is better not
2021-01-24 14:53:37 +04:00
ITOH 8d8c792747 feat(handlers): add getInvite() & deleteInvite() (#421)
* feat(handlers): add getInvite

* feat(handlers): add deleteInvite

* remove deving things

* add jsdoc

* move functions up

* import got deleted

* feat(handlers): invite better types

* throw enum error

* remove unnecessary checks

* Update mod.ts

* channel exists since botHasChannelPermissions did not throw any error
2021-01-23 23:33:12 +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 55235e5ea0 feat(handlers): add getTemplate() (#422)
* feat(handlers): getTemplate

* update jsdoc

* redirect this function

* remove getGuildTemplate

* Update src/api/handlers/guild.ts

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

* remove breaking change

* save in const

* Update src/api/handlers/guild.ts

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

* Update src/api/handlers/guild.ts

* Update src/api/handlers/guild.ts

* Update mod.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>
Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2021-01-23 23:17:50 +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 76e0395319 fix(handlers): add missing handlers (#436) 2021-01-23 23:13:06 +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
ITOH e62b52d160 feat(handlers): check for message max delete days (#416)
* check prune max days

* patch(handlers): max days is 30

* change in description too

* fix: merge problems
2021-01-21 10:57:05 +04:00
ITOH 16fab1b925 feat(handlers): add editBotNickname() (#415)
* feat(handlers): add editBotNickname

* return a var

* Update member.ts

* Update src/api/handlers/member.ts

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

* Update member.ts

* Update member.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>
2021-01-20 15:31:48 +04:00
ITOH 11b68981f9 feat(handlers): add getGuildPreview() (#408)
* add(handlers): getGuildPreview

* update comment

* check if guild is discoverable

* remove checking since getGuild does not work on unjoined guilds
2021-01-20 14:22:04 +04:00
ITOH 4ee701b159 feat(handlers): add startTyping() (#404)
* feat(handlers): triggerTypingIndicator function

* add period

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

* startTyping is better

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

Co-authored-by: Ayyan <ayyantee@gmail.com>
Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2021-01-20 13:47:37 +04:00