npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

discord-bot-youtube-notifications

v1.3.0

Published

An module to get youtube notifications.

Downloads

51

Readme

Installations

npm i discord-bot-youtube-notifications

What?

An module to easily recive Youtube uploads notification.

Why?

  • Easy to use.
  • Active Support on discord server.
  • No API key needed.
  • psst~ low quota api route supported!

Note

  • At least Node JS 14 is required.
  • The feeds thing of youtube takes some time to update, so the notifications might be bit slow.

How ?

Warning: Either install quick.db or input mongoUrl property so the package will work

  • Basic Notifications

const youtube = require('discord-bot-youtube-notifications');

// The client is the Discord Client
const Notifier = new youtube.notifier(client);

const youtube_channel_id = "UCSqcbw8r8TZKYUhx4mufvNg";
const discord_channel_id = "732883841395720213";

// The channel ID is options
Notifier.addNotifier(youtube_channel_id, discord_channel_id);
  • Custom Message

const youtube = require('discord-bot-youtube-notifications');

const Notifier = new youtube.notifier(client, {
    // If you do not add message parameter in addNotifier than this message is used
    message: "Hello @everyone, **{author}** just publish a cool video called **{title}**\nGo show your support\n\nurl : {url}\n\nThumbnail: {thumbnail}"
});

const youtube_channel_id = "UCSqcbw8r8TZKYUhx4mufvNg";
const discord_channel_id = "732883841395720213";

Notifier.addNotifier(youtube_channel_id, discord_channel_id);

// A different message
Notifier.addNotifier("Another Channel ID", discord_channel_id, "Hello guys, A nerd called **{author}** just publish a shit video called **{title}**\nGo dislike it\n\nurl : {url}\nThumbnail: {thumbnail}");
  • Advanced options

const youtube = require('discord-bot-youtube-notifications');

const Notifier = new youtube.notifier(client, {
    // Default message
    message: "Hello @everyone, **{author}** just publish a cool video called **{title}**\nGo show your support\n\nurl : {url}",

    // Time interval to check for new uploads
    updateTime: 60000, // in milliseconds,

    // Give the mongo URI if you wanna save data in mongoose otherwise quick.db is used
    mongoURI: "mongo+srv://something",

    // Auto send the embed to the provided channel
    autoSend: true, // if false you will get A "upload" event

    // The youtube data v3 API key, Send this if you want updates to be fast and precise because without the key it take 10-15 minutes more time to get latest videos
    apiKey: "the key",
});
  • Listening to events

Notifier.on("upload", (client, data) => {
  // Do something with your data
});

// Example Data 
const data = {
    youtube: "UCSqcbw8r8TZKYUhx4mufvNg", // The Youtube channel ID
    channel: channelID, // The discord channel ID
    lastVideo: last.link || "", // Latest video link
    message: "new upload", // Custom message
    author: "Krazy Developer", // The name of youtube channel
    title: "How to code", // title of the video
    link: "https://www.youtube.com/watch?v=CmK5JLt0GQ4", // Link of the video
    thumbnail: "https://i.ytimg.com/vi/E7sZqOnZUrA/hqdefault.jpg", // image url of the thumbnail
}
  • Utility functions

// To edit the notifier's channel ID, or the message, If you don't wanna change one of the property just give undefined in its place
Notifier.editNotifier(youtubeId, channelID, message);

// To remove a notifier
Notifier.removeNotifier(youtubeId)

Support

for support or issues or queries contace me on my discord server.