Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Event and websocket integration #560

Open
TheDogHusky opened this issue Feb 12, 2024 · 3 comments
Open

[FEATURE REQUEST] Event and websocket integration #560

TheDogHusky opened this issue Feb 12, 2024 · 3 comments
Labels
enhancement feature Things that would be nice to have

Comments

@TheDogHusky
Copy link

I’ve recently had an idea:
Since chibisafe doesn’t have integrations like discord webhook alerts, and other things like this I’ve thought of making a node.js library with events and websocket connection so you could just listen to any events from the server like so:

const { Client } = require("chibisafe.js");

const client = new Client({
     apiKey: "API KEY",
     url: "https://safe.classydev.fr",
     asAdmin: true // Could make different clients for admin or client api keys
});

client.on("ready", () => {
    console.log("Connected to Chibisafe");
});

client.on("fileUploaded", file => {
    console.log(file.name);
    console.log(file.album) // will return nothing if there is no album
}); 

client.connect();

as well you could access all the files, make searches, delete some, etc.. with a discord.js-like syntax (client.files.search(query).then(file => file.delete());)

idk maybe a library like this has already been made, but i’d like to know if there’s a way to connect to the gateway with an api key and then listen to events like so.
Could be a great idea and make communities grow as in combinaison with Discord.js you could make a Chibisafe bot to upload files, manage them, etc..

@iCrawl
Copy link
Contributor

iCrawl commented Feb 12, 2024

We could definitely support native Webhook support from certain providers.

All youd have to do as the user is then supply the webhook link and we can post on specific actions to that webhook.

@TheDogHusky
Copy link
Author

Tho a library could be cool, as you made the greatest Discord JavaScript library but yeah webhook could be useful

@TheDogHusky
Copy link
Author

Or probably be able to make your own integrations

@Pitu Pitu added enhancement feature Things that would be nice to have labels Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature Things that would be nice to have
Projects
None yet
Development

No branches or pull requests

3 participants