Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paring-chan/erisutils
https://github.com/paring-chan/erisutils
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/paring-chan/erisutils
- Owner: paring-chan
- Created: 2020-10-30T11:31:52.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T20:29:08.000Z (about 1 year ago)
- Last Synced: 2024-12-31T07:45:51.085Z (3 days ago)
- Language: TypeScript
- Size: 127 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Eris Utils
eris 에서 사용 가능한 유틸리티들을 모아놓은 라이브러리 입니다.
#### 설치
```shell script
# NPM
npm install @chinobot/eris-utils# YARN
yarn add @chinobot/eris-utils
```#### 설정
Typescript/ES6
```ts
import {ErisUtilClient} from '@chinobot/eris-utils'const bot = new ErisUtilClient('token', {
listener: {
dir: path.join(__dirname, 'listeners'),
watch: true
},
initialEvents: {
log: (msg: string) => console.log(`[LOG] ${msg}`)
}
})
bot.connect()
```Javascript
```js
const {ErisUtilClient} = require('@chinobot/eris-utils')const bot = new ErisUtilClient('token', {
listener: {
dir: path.join(__dirname, 'listeners'),
watch: true
},
initialEvents: {
log: (msg: string) => console.log(`[LOG] ${msg}`)
}
})bot.connect()
```### 리스너 예시(ready)
Typescript
```ts
import {Command, ErisUtilClient} from '@chinobot/eris-utils'export default class Ready extends Command {
constructor(client: ErisUtilClient) {
super(client, 'client', 'ready');
}execute() {
console.log(`Logged in as ${this.bot.client.user.username}#${this.bot.client.user.discriminator}`)
}
}
```Javascript
```js
const {Command, ErisUtilClient} = require('@chinobot/eris-utils')export default class Ready extends Command {
constructor(client: ErisUtilClient) {
super(client, 'client', 'ready');
}execute() {
console.log(`Logged in as ${this.bot.client.user.username}#${this.bot.client.user.discriminator}`)
}
}
```