Commit Graph

36 Commits

Author SHA1 Message Date
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
ITOH 874f1ee979 feat(handlers): add getEmoji() & getEmojis() (#406)
* add(handlers): getEmojis

* add(handlers): getEmoji

* fix cache

* addToCache argument

* addtocache default to true

* Update guild.ts

* remove this

* Update src/api/handlers/guild.ts

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

* Update src/api/handlers/guild.ts

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

Co-authored-by: Ayyan <ayyantee@gmail.com>
2021-01-20 13:46:35 +04:00
ITOH 2cc513b874 feat(handlers): add editChannelOverwrite() & deleteChannelOverwrite() (#403)
* add editChannelOverwrite function

* remove body constant

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

* format

* Update src/api/handlers/guild.ts

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

* Update src/api/handlers/guild.ts

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

* add deleteChannelOverwrite function

* Mark permission in jsdoc

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

Co-authored-by: Ayyan <ayyantee@gmail.com>
2021-01-20 13:43:35 +04:00
ITOH 7db3f65cbd feat(handlers): add kickFromVoiceChannel() function (#407) 2021-01-20 13:21:13 +04:00
ITOH 727a60551a feat(handlers): inhibitors for deleteChannel() (#401)
* better deleteChannel function

* throw error if guild wasn't found

* remove dm close ability

* change this comment again

* guildID should be first
2021-01-19 18:20:12 +04:00
Ayyan 4c9171e72a fix(handlers): support for custom emoji in reaction remove functions (#400) 2021-01-19 18:10:28 +04:00
ITOH 8b663ca4de refactor(util): update endpoints (#383)
* Update constants.ts

* fiiiixxxx

* dupe

* Update src/util/constants.ts

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

* USER_DM

* fix this and remove that

* Update src/util/constants.ts

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

* Update constants.ts

* Update src/util/constants.ts

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

* Update src/util/constants.ts

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

* need these

* hmm

* rename GUILD_EMBED to GUILD_WIDGET

* idk

* Update src/util/constants.ts

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

* Update constants.ts

* Update constants.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>
2021-01-17 20:34:34 +04:00
Skillz4Killz cd0347a5e1 feat: standalone rest server (#290)
* feat: standalone rest server

* desc

* fmt

* <3 vlad

* Update src/rest/README.md

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

* Update src/rest/README.md

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

* Update README.md

* Update src/rest/deps.ts

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

* Update src/rest/queue.ts

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

* chore: ignore no-explicit-any rule

* fix(rest): replace with correct import paths

* deno fmt

* fixes

* fmt

* use user agent cons

* fix typings

* Update src/rest/cache.ts

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

* Update src/rest/cache.ts

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

Co-authored-by: Ayyan <ayyantee@gmail.com>
2021-01-09 21:53:14 +04:00
Ayyan 27fb44128f refactor: replace "return await" (#354) 2021-01-09 21:48:02 +04:00
Ayyan cd7973273e fix(misc): check whether guilds' loaded every 2s (#353)
* fix(misc): check whether guilds' loaded every 2s

* unavailable_guilds -> guilds

* guilds -> unavailable_guilds

* Separate unavailable guild  type

* Clean up and apply suggested changes
2021-01-09 21:39:25 +04:00
Ayyan e5a8f3b358 chore: setup "deno lint" (#331)
* chore: setup "deno lint"

* ci(lint): add --unstable flat to lint script

* lint

* lint

* refactor: destructure assignment for Message#guildID

* chore: remove TODO comment

* refactor: remove redundant async

* chore: switch to Deno stable vscode ext

* chore: remove ignore comments

* chore: remove ignore comments

* chore: remove @ts-ignore comment

* fixes

* fixes

* chore: remove deno-lint-ignore comment

* chore: add index signature
2021-01-03 20:12:42 +04:00
ayntee 32c3306bf0 fix: outdated pin & unpin handlers and endpoints 2021-01-02 17:10:18 +04:00
Ayyan 6e1afa13a4 docs(handlers): add jsdoc comment block (#313)
* docs(handlers): add jsdoc comment block

* style: format files
2020-12-31 19:51:42 +04:00
TriForMine d53725d069 fix: use correct bitwise operator (#302)
* Fix permissions (sorry my ide changed & to &&)

* Change botHasChannelPermissions to async.
This seems to have fixed my issue for my bot

* Remove async for botHasChannelPermissions

* Add async back for botHasChannelPermissions since it doesn't work without it

* Remove async, the issues were something else apparently
2020-12-30 17:35:39 +04:00
TriForMine 484f86638f refactor: resolve async promises, fixed typos, and used inline variable for return (#299)
* Added await in async function, fixed typos and used inline variable for return

* Added await in async function, fixed typos and used inline variable for return

* Revert "Added await in async function, fixed typos and used inline variable for return"

This reverts commit f31caf5d

* Added await in async function, fixed typos and used inline variable for return

* Fixes format

* Fixes format 2

* Fixes format 4475757

* Fixes format 878757854786312378657865785785785785

* Change return to await

* Fixing more issues

* Fixing even more issues

* Fixing even more issues +

* Fixes format
2020-12-30 12:31:11 +04:00
Skillz 189dc150f2 rename to mod.ts 2020-12-26 19:30:32 -05:00
ayntee d793a46497 Merge branch 'next' of https://github.com/discordeno/discordeno into getters 2020-12-26 19:46:17 +04:00
ayntee 8e3fab7411 fix: remove util/cdn export 2020-12-24 17:59:15 +04:00
ayntee 321175a72f Revert "chore: verbose imports"
This reverts commit dfe6f371d3.
2020-12-23 11:03:06 +04:00
ayntee dfe6f371d3 chore: verbose imports 2020-12-22 22:59:09 +04:00
ayntee 7d183b9bef Merge branch 'next' of https://github.com/discordeno/discordeno into getters 2020-12-22 22:06:41 +04:00
Skillz4Killz 19f228c329 feat: slash commands and interactions (#248)
* start slash commands

* lil bit of this

* a little bit of that

* chore: add slash commands' types  (#249)

* Add slash Types

* style: format source files

* interaction create event

* make it a valid controller

* respond to a slash command

* interactions

* shtuff

* gotta get them all

* you gotta hit the bullseye

* you gotta survive

* most important thing i forgot

* please keep this

* more shuttttfgvuasdafwesdvjzdk

* more endpoints

* TYPO

* making that party jam

* this is my jam

* refactor: move slash commands types to webhook.ts (#250)

* Move Types

* Move to webhook.ts types file

* Update webhook.ts

* fix: update ExecuteSlashCommandOptions (#252)

* Move Types

* idk

* Remove Unnecessary Comment

* details

* http side of slash

* Format

* idk

* cleanup

* fmt

* fix imports

* tet

* remove log

* Update interactions.ts

* Update interactions.ts

* Update interactions.ts

* Use tweetnacl_deno for verification

* chore: move tweetnacl import to deps.ts

* Update deps.ts

* deps: use tweetnacl from GitHub

* fix: use serverOptions.slashHexKey

* fix: res -> req

* fix: use TextEncoder

* deps: add std@0.81.0/encoding/hex.ts

* chore: use encode() from std/encoding/hex.ts

* I am using the GitHub online editor pls help

* Update deps.ts

* Update interactions.ts

* Update interactions.ts

* Update interactions.ts

* Update interactions.ts

* fix: respond with 400 if timestamp and signature not present

* style: format files

* refactor!: merge createServer() into startServer()

* style: format files

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>
Co-authored-by: ayntee <ayyantee@gmail.com>
2020-12-22 21:39:01 +04:00
Ayyan e49a23687e refactor!: organize directories and files (#268)
* refactor!: organize directory structure

* fix: avoid stack overflow err

* chore: swtch back to std/encoding for base64

* style: format source files
2020-12-22 21:26:27 +04:00