Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pauldb09/eris-utils
Adds collectors, sweepers and some other things to eris
https://github.com/pauldb09/eris-utils
Last synced: 27 days ago
JSON representation
Adds collectors, sweepers and some other things to eris
- Host: GitHub
- URL: https://github.com/pauldb09/eris-utils
- Owner: pauldb09
- License: mit
- Created: 2022-07-12T17:33:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-16T16:07:46.000Z (about 2 years ago)
- Last Synced: 2024-09-15T22:43:23.296Z (about 2 months ago)
- Language: TypeScript
- Size: 66.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eris-utils
Adds collectors, sweepers and some other things to eris
**Getting Started**
Start by downloading the package from npm using the command line:
```
npm install eris-utilities@latest
```Then you can use it on your own bot, here it a little example with javascript:
**Create Message collectors**
```js
const Eris = require("eris")
const { CollectorManager, SweeperManager, extendClient } = require("eris-utilities")const client = new Eris("BOT_TOKEN",{
intents: ["guilds"]
});// extendClient(client) OR:
client.collectors = new CollectorManager(client);client.on("interactionCreate", interaction=>{
if(interaction.data.name === "ping"){
interaction.createMessage("Answer with pong to interact!")
const collector = client.collectors.createMessageCollector({
channelId: interaction.channel.id,
userId: interaction.member.id,
time: 6000,
filter: (msg) => msg.content === "pong",
})collector.on("response", msg =>{
})
collector.on("end", msg =>{
})
}
})client.connect()
```**Sweepers**
```js
const Eris = require("eris")
const { SweeperManager } = require("eris-utils")const client = new Eris("YOUR_TOKEN", {
intents: ["guildMessages"]
});client.collectors = new CollectorManager(client);
client.sweepers = new SweeperManager(client, {
members: {
delay: 1000*60*60,
// excludeClient: true,
// excluteInVoice: true,
// If filter is passed, excluteInVoice and excludeClient will both be ignored// Just an example
filter: (m)=> m.guild.id !== "XX";
},
channels: {
delay: 1000*60*60;
filter: (m) => m;
}
})client.connect()
```