Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

perforce_discord_webhook_module

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

perforce_discord_webhook_module

[![npm](https://img.shields.io/npm/l/perforce_discord_webhook_module.svg)](https://github.com/MMOCreators/perforce_discord_bridge/blob/master/LICENSE.md) [![npm](https://img.shields.io/npm/v/perforce_discord_webhook_module.svg)](https://img.shields.io/npm

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-77.78%
Maintainers
1
Weekly downloads
 
Created
Source

Perforce <-> Discord Module

npm npm

This plugin allows you to make Queries against a Perforce Server, to check the newest edition and send a Webhook to Discord if it is newer then previously stored.

Why this was Created?

I am working on Developing a Game, and I really got annoyed there was nothing that would notify me from Perforce built-in. So made this.

How to Install

$ npm install --save perforce_discord_webhook_module

Requirements

  • apt-get install --yes helix-cli installed on a Linux Machine
  • choco install p4 installed on a Windows Machine

Projects using the Plugin

Example

require('dotenv').config()

var moment = require('moment-timezone');
moment().tz(process.env.CRON_TIMEZONE).format();

var CronJob = require('cron').CronJob;
const path = require('path')

var P4Handler = require('perforce_discord_webhook_module');
const Perforce = new P4Handler(process.env.P4_PASSWD,process.env.P4_USER,process.env.P4_PORT,path.join(__dirname, process.env.SAVE_FILE),process.env.CRON_TIMEZONE,process.env.DISCORD_URL);

var job = new CronJob(process.env.CRON_TIME, function() {
    Perforce.runCron().then((sent) => {
        if (sent) {
            console.log(`New Data Found, Webhook Sent: ${moment()}`)
        }
    }).catch((err) => {
        console.error(err);
    })
}, null, true, process.env.CRON_TIMEZONE);

Perforce.loadConfig().then(() => {
    return Perforce.login().then(() => {
        job.start();
    });
}).catch((err) => {
    console.error(err);
    throw err;
})

FAQs

Package last updated on 19 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc