https://discordjs.guide/preparations/#installing-node-js
-
What is Events/Listeners?
-
How to create commands with Message Event
-
How to create an command handler
-
How to separate commands in files
| import { clearDatabase, closeDatabase, connectDatabase } from '../../../../../tests/mongo'; | |
| import { mutate } from '../../../../../tests/app'; | |
| import { createUserFixture } from '../../../../../tests/user.factory'; | |
| import ERRORS from '../../../../errors'; | |
| beforeAll(async () => await connectDatabase()); | |
| beforeEach(async () => { | |
| await clearDatabase(); |
| // Data | |
| // [ | |
| // { | |
| // "key": 1, | |
| // "seasons": [ | |
| // { | |
| // episodes: [ | |
| // 3, | |
| // 3 | |
| // ] |
| <script> | |
| const a = document.querySelector("table tbody"); | |
| const getPersons = async (count = 30) => { | |
| const response = await fetch( | |
| "https://randomuser.me/api/?results=" + count | |
| ); | |
| const data = await response.json(); | |
| return data.results.map((person) => { |
| export enum BulkTypes { | |
| SEQUENCE = 'SEQUENCE', | |
| NOT_SEQUENCE = 'NOT_SEQUENCE', | |
| } | |
| interface NotSequenceValue { | |
| numbers: number[]; | |
| type: BulkTypes.NOT_SEQUENCE; | |
| } |
| const watchedEpisodesNow = ( | |
| media: IMedia, | |
| season: ISeason, | |
| episode: IEpisode, | |
| watched: WatchedDocument | null, | |
| sawPrevius: boolean, | |
| ): [IEpisode[], SeasonWatch[]] => { | |
| if (!watched) { | |
| // CREATE NEW WATCHED |
| import { makeID, mutate } from '../../../../../tests/app'; | |
| import { clearDatabase, closeDatabase, connectDatabase } from '../../../../../tests/mongo'; | |
| import ERRORS from '../../../../errors'; | |
| import { createUserFixture, createUserFixtureAndToken } from '../../../../../tests/user.factory'; | |
| import folllowModel from '../../folllow.model'; | |
| beforeAll(async () => await connectDatabase()); | |
| beforeEach(async () => { | |
| await clearDatabase(); |
| type TokenTranslation<Namespaces, R extends boolean = false> = Extract< | |
| keyof { | |
| [Key in Extract<keyof Namespaces, string> as Namespaces[Key] extends | |
| | string | |
| | number | |
| ? `${Key}` | |
| : `${Key}${R extends true ? "." : ":"}${TokenTranslation< | |
| Namespaces[Key], | |
| true | |
| >}`]: unknown; |
https://discordjs.guide/preparations/#installing-node-js
What is Events/Listeners?
How to create commands with Message Event
How to create an command handler
How to separate commands in files
| import mongoose, { Types, Document } from 'mongoose'; | |
| import { | |
| Adapter, | |
| AdapterUser, | |
| AdapterSession, | |
| VerificationToken as AdapterVerificationToken, | |
| } from 'next-auth/adapters'; | |
| import { Account as AdapterAccount } from 'next-auth'; |