Socket
Socket
Sign inDemoInstall

camphouse.js

Package Overview
Dependencies
3
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

34

camphouse.js

@@ -11,4 +11,9 @@ const axios = require('axios');

this.interval = null;
this.commands = {};
}
on(command, callback) {
this.commands[command] = callback;
}
async login(email, password) {

@@ -29,7 +34,8 @@ try {

for (const post of newPosts) {
const postId = post.id;
const commentsResponse = await axios.get(`${BASE_URL}/comments/post/${postId}`, {
headers: { Authorization: `Bearer ${this.token}` },
});
post.comments = commentsResponse.data.data;
// Check if the post content contains a command and execute corresponding functionality
for (const command in this.commands) {
if (post.content.includes(command)) {
this.commands[command](post);
}
}
}

@@ -56,20 +62,2 @@ return newPosts;

}
handleInteractionPostCreate(post) {
const command = 's!randomnumber'; // Example command to check for
if (post.content.includes(command)) {
// Handle the command functionality for post creation
// Assuming this is how you create a post (modify as needed)
console.log(`Post ${post.id} contains the command: ${command}`);
}
}
handleInteractionCommentCreate(comment) {
const command = 's!randomnumber'; // Example command to check for
if (comment.comment.includes(command)) {
// Handle the command functionality for comment creation
// Assuming this is how you create a comment (modify as needed)
console.log(`Comment ${comment._id} contains the command: ${command}`);
}
}
}

@@ -76,0 +64,0 @@

{
"name": "camphouse.js",
"version": "1.0.1",
"version": "1.0.2",
"description": "A package to interact with the Camphouse API",

@@ -5,0 +5,0 @@ "main": "camphouse.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc