Draft:switch from eris to discord.js, formatting #13
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "master"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
switch from Eris to discord.js v13
src/api/routes/Account.ts
has some errors:code:
error:
Why are you manually specifying types? The transpiler should infer the types by default.
Ignore IDE and text editor files.
https://gitlab.libraryofcode.org/engineering/cloudservices/-/merge_requests/5#note_1428 You can just ignore the entire
~/.vscode
directory.Although I believe the correct convention for camel case in TypeScript would be
Id
instead ofID
, it might be best to seek approval from @matthew before changing this because it changes the API schema and the database. It's a critical refactor.https://gitlab.libraryofcode.org/engineering/cloudservices/-/merge_requests/5#note_1430 Same applies with this.
Since a significant portion of the changes involve changing the casing of
ID
toId
in many places, I'd advise discussing with Matthew. Refer to https://gitlab.libraryofcode.org/engineering/cloudservices/-/merge_requests/5#note_1430 to find out why.Req
is a custom type which extends Express'Request
type.I prefer
ID
.Discord.js v13 now uses
Id
, instead ofID
, which it used to have. I wanted to make everything follow the same convention, so we wouldn't have any confusion. I'll revert the change if you feel that we should stay withID
.This was already there. I didn't change that part.
changed this line in version 2 of the diff
changed this line in version 2 of the diff
added 1 commit
ebbbc679
- remove .vscode/Compare with previous version
changed this line in version 3 of the diff
changed this line in version 3 of the diff
added 1 commit
aebfb7a5
- use ID instead of IdCompare with previous version
Why are there double awaits here?
The previous line was also fetching the member from the cache, not from REST.
Fetch from cache.
Doesn't this function want a Member?
Same thing here, fetch from the cache if you can. We don't need to unnecessarily contact the API every time, it wastes resources.
cache
cache
Remove this intent.
Remove this intent.
Remove this intent.
Keep this a one-liner please.
Why is
TextChannel
being imported if it is never used?cache
cache
What's up with the type conversion here?
cache
Shouldn't this be
Member
?Try to fetch from cache first before getting from REST.
I'm going to go to the Board with this MR. It's not guaranteed we'll even be able to merge it as it doesn't have Board approval at this time.
I updated the function to use a User, to make the code a bit cleaner, because of the extra conditional checks needed.
refer to https://gitlab.libraryofcode.org/engineering/cloudservices/-/merge_requests/5#note_1461
Thats fine.
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in version 4 of the diff
added 1 commit
9ada0b1d
- changes requested by matthewCompare with previous version
We might want to keep integrations.
Some threads resolved, others still needing response.
requested review from @matthew
added 1 commit
11b4828d
- use cache when possibleCompare with previous version
added 1 commit
7629d328
- add guild integrations intent backCompare with previous version
Which part are you referring to?nevermindchanged this line in version 7 of the diff
added 1 commit
9b412ae7
- one linerCompare with previous version
I can't reproduce the error locally.
Well, then that's good.
resolved all threads
@matthew Is the bot able to run? If so, can you test all of the commands, as I can't do that without setting up everything?
It's unfortunate there isn't a pagination library that supports Discord.js v13. Hopefully, we can migrate to it once one is developed.
resolved all threads
Uploading IDE and text editor files is not recommended by default, but it seems that the source code for Cloud Services already had the
.vscode
folder (unignored).In that case, should we keep it unignored? Requesting further clarification from @matthew.
Also, if you're ignoring IDE and text editor files, why unignore the
.idea
folder? It's generally for JetBrains IDEs.Why change the version?
Are you sure that these upgrades won't cause compatibility issues and unintentionally break things?
Why did you change the
build
script?The project uses Yarn for managing dependencies, not npm; hence why the
package-lock.json
file was ignored by Git.I believe that the breaking changes from updating the dependencies don't affect the current code.
changed this line in version 8 of the diff
changed this line in version 8 of the diff
added 1 commit
2870b4a4
- update package.jsonCompare with previous version
changed this line in version 9 of the diff
added 1 commit
9bac31de
- update .gitignoreCompare with previous version
added 1 commit
4c2690d7
- update gitignore (again)Compare with previous version
added 1 commit
87b320f2
- fix paginationCompare with previous version
I haven't had a look at the rest but a fair number of the dependencies have been updated with major (possibly breaking) changes. I trust that you've reviewed the changes before updating them though.
Resolved in
2870b4a4ac
.resolved all threads
Collection#get
is a synchronous function. Theawait
keyword is unnecessary.No need for the
await
keyword on synchronous functions.GuildMemberRoleManager#add
returns a Promise. It should be awaited.https://gitlab.libraryofcode.org/engineering/cloudservices/-/merge_requests/5#note_1516
https://gitlab.libraryofcode.org/engineering/cloudservices/-/merge_requests/5#note_1516
https://gitlab.libraryofcode.org/engineering/cloudservices/-/merge_requests/5#note_1516
changed this line in version 12 of the diff
changed this line in version 12 of the diff
changed this line in version 12 of the diff
changed this line in version 12 of the diff
changed this line in version 12 of the diff
changed this line in version 12 of the diff
added 1 commit
3cfefda5
- useless awaitsCompare with previous version
resolved all threads
approved this merge request
approved this merge request
DEPT-ENG & Board approved.