diff --git a/LICENSE b/LICENSE index 223e41e..2db9429 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Sobhan-SRZA (mr.sinre) & Persian Caesar +Copyright (c) 2024 Sobhan-SRZA (mr.sinre) & Persian Caesar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index f6cb182..5562422 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,7 @@ The aparat website services in one package free to use and more quality. An example to how catch user information like followers count and etc: ```js const { API } = require("aparat.js"); - const api = new API(); - (async () => { // User information results. diff --git a/src/components/error.ts b/src/components/error.ts index 0d92c56..6e373fd 100644 --- a/src/components/error.ts +++ b/src/components/error.ts @@ -1,3 +1,7 @@ export class error extends Error { - this.name = "aparat.js" + constructor(message: string) { + super(); + this.name = "aparat.js"; + this.message = message; + } } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 2297c70..6e7b518 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,5 @@ import { User } from "./components/user"; import { Video } from "./components/video"; -import { EventEmitter } from 'events'; export = { /** * @class @@ -14,9 +13,10 @@ export = { * const api = new API(); * ``` */ - API: class API extends EventEmitter { + API: class API { + user: User; + video: Video; constructor() { - super(); this.user = new User(); this.video = new Video(); }; @@ -38,18 +38,18 @@ export = { * }); * ``` */ - checkStream(username: string) { - let user; - let name = "streamStart"; - this.once(name, async () => { - user = await this.user.search(username); - if (user.live.is_live) { - this.emit(name, user); - return user; - }; - }); - this.emit(name, user); - } + // checkStream(username: string) { + // let user; + // let name = "streamStart"; + // this.once(name, async () => { + // user = await this.user.search(username); + // if (user.live.is_live) { + // this.emit(name, user); + // return user; + // }; + // }); + // this.emit(name, user); + // } } }; /**