New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

discordly

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discordly

<a hr

  • 11.1.6-part-1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

discordly


Discord server NPM version NPM downloads

Important

Discordly is still in development. The embed and button system can not send more then 1 embed and button per message.

About

discordly is a powerful Node.js module that allows you to easily interact with the Discord API.

  • Object-oriented
  • Predictable abstractions
  • Performant
  • 100% coverage of the Discord API

Default usage

const Discordly = require('discordly')
const client = new Discordly.Client({intents: [Discordly.Intents.FLAGS.GUILDS, Discordly.Intents.FLAGS.GUILD_MESSAGES, Discordly.Intents.FLAGS.GUILD_MESSAGE_REACTIONS]})

client.on('ready', () => {
  console.log(`${client.me.tag} is ready.`)
})

client.on('message', message => {
    if(message.author.bot) return;

    if(message.content == '!help'){
      message.channel.send('I\'m here to help.')
    }
})

client.login('Your secret bot token.')

Example usage

Embeds (No Buttons or Text)
const Discordly = require('discordly')
const client = new Discordly.Client({intents: [Discordly.Intents.FLAGS.GUILDS, Discordly.Intents.FLAGS.GUILD_MESSAGES, Discordly.Intents.FLAGS.GUILD_MESSAGE_REACTIONS]})

client.on('ready', () => {
  console.log(`${client.me.tag} is ready.`)
})

client.on('message', message => {
    if(message.author.bot) return;

    if(message.content == '!help'){
      var helpEmbed = new Discordly.DiscordEmbed()
      .setTitle('Help 🌐')
      .setColor('RANDOM')
      .addField('Moderation', "View moderation commands by doing: `help moderation`")
      message.channel.send({embeds: [helpEmbed]})
    }
})

client.login('Your secret bot token.')

Buttons (No Embeds or Text)
const Discordly = require('discordly')
const client = new Discordly.Client({intents: [Discordly.Intents.FLAGS.GUILDS, Discordly.Intents.FLAGS.GUILD_MESSAGES, Discordly.Intents.FLAGS.GUILD_MESSAGE_REACTIONS]})

client.on('ready', () => {
  console.log(`${client.me.tag} is ready.`)
})

client.on('message', message => {
    if(message.author.bot) return;

    if(message.content == '!help'){
    var helpButton = new DiscordButton()
    .setName(`Help button 🔲`)
    .setStyle('Primary')
    .setId('Help Button')
      message.channel.send({button: [helpButton]})
    }
})

client.on('ButtonClicked', async(button) => {
   if(button.id == 'Help Button'){
      var helpEmbed = new Discordly.DiscordEmbed()
      .setTitle('Help 🌐')
      .setColor('RANDOM')
      .addField('Moderation', "View moderation commands by doing: `help moderation`")
    button.channel.send({embeds: [helpEmbed]})
   }
})

client.login('Your secret bot token.')

Text (No Embeds or Buttons)
const Discordly = require('discordly')
const client = new Discordly.Client({intents: [Discordly.Intents.FLAGS.GUILDS, Discordly.Intents.FLAGS.GUILD_MESSAGES, Discordly.Intents.FLAGS.GUILD_MESSAGE_REACTIONS]})

client.on('ready', () => {
  console.log(`${client.me.tag} is ready.`)
})

client.on('message', message => {
    if(message.author.bot) return;

    if(message.content == '!help'){
      message.channel.send(`I'm here to help`)
    }
})

client.login('Your secret bot token.')

Text & Buttons (No embeds)
const Discordly = require('discordly')
const client = new Discordly.Client({intents: [Discordly.Intents.FLAGS.GUILDS, Discordly.Intents.FLAGS.GUILD_MESSAGES, Discordly.Intents.FLAGS.GUILD_MESSAGE_REACTIONS]})

client.on('ready', () => {
  console.log(`${client.me.tag} is ready.`)
})

client.on('message', message => {
    if(message.author.bot) return;

    if(message.content == '!help'){
      var helpButton = new DiscordButton()
      .setName(`Help button 🔲`)
      .setStyle('Primary')
      .setId('Help Button')
      message.channel.send(`I'm here to help`, {buttons: [helpButton]})
    }
})

client.on('ButtonClicked', async(button) => {
   if(button.id == 'Help Button'){
      var helpEmbed = new Discordly.DiscordEmbed()
      .setTitle('Help 🌐')
      .setColor('RANDOM')
      .addField('Moderation', "View moderation commands by doing: `help moderation`")
    button.channel.send(`Help is here :D`, {embeds: [helpEmbed]})
   }
})

client.login('Your secret bot token.')

Text & Embeds (No Buttons)
const Discordly = require('discordly')
const client = new Discordly.Client({intents: [Discordly.Intents.FLAGS.GUILDS, Discordly.Intents.FLAGS.GUILD_MESSAGES, Discordly.Intents.FLAGS.GUILD_MESSAGE_REACTIONS]})

client.on('ready', () => {
  console.log(`${client.me.tag} is ready.`)
})

client.on('message', message => {
    if(message.author.bot) return;

    if(message.content == '!help'){
            var helpEmbed = new Discordly.DiscordEmbed()
      .setTitle('Help 🌐')
      .setColor('RANDOM')
      .addField('Moderation', "View moderation commands by doing: `help moderation`")
      message.channel.send(`I'm here to help`, {embeds: [helpEmbed]})
    }
})

client.login('Your secret bot token.')

Buttons & Embeds (No Text)
const Discordly = require('discordly')
const client = new Discordly.Client({intents: [Discordly.Intents.FLAGS.GUILDS, Discordly.Intents.FLAGS.GUILD_MESSAGES, Discordly.Intents.FLAGS.GUILD_MESSAGE_REACTIONS]})

client.on('ready', () => {
  console.log(`${client.me.tag} is ready.`)
})

client.on('message', message => {
    if(message.author.bot) return;

    if(message.content == '!help'){
      var helpEmbed = new Discordly.DiscordEmbed()
      .setTitle('Help 🌐')
      .setColor('RANDOM')
      .addField('Moderation', "View moderation commands by doing: `help moderation`")

      var helpButton = new DiscordButton()
      .setName(`Help button 🔲`)
      .setStyle('Primary')
      .setId('Help Button')

      message.channel.send({embeds: [helpEmbed], buttons:[helpButton]})
    }
})

client.on('ButtonClicked', async(button) => {
   if(button.id == 'Help Button'){
      var helpEmbed = new Discordly.DiscordEmbed()
      .setTitle('Help 🌐')
      .setColor('RANDOM')
      .addField('Moderation', "View moderation commands by doing: `help moderation`")
    button.channel.send({embeds: [helpEmbed]})
   }
})


client.login('Your secret bot token.')

Text, Buttons & Embeds
const Discordly = require('discordly')
const client = new Discordly.Client({intents: [Discordly.Intents.FLAGS.GUILDS, Discordly.Intents.FLAGS.GUILD_MESSAGES, Discordly.Intents.FLAGS.GUILD_MESSAGE_REACTIONS]})

client.on('ready', () => {
  console.log(`${client.me.tag} is ready.`)
})

client.on('message', message => {
    if(message.author.bot) return;

    if(message.content == '!help'){
      var helpEmbed = new Discordly.DiscordEmbed()
      .setTitle('Help 🌐')
      .setColor('RANDOM')
      .addField('Moderation', "View moderation commands by doing: `help moderation`")

      var helpButton = new DiscordButton()
      .setName(`Help button 🔲`)
      .setStyle('Primary')
      .setId('Help Button')

      message.channel.send(`I'm here to help.`, {embeds: [helpEmbed], buttons:[helpButton]})
    }
})

client.on('ButtonClicked', async(button) => {
   if(button.id == 'Help Button'){
      var helpEmbed = new Discordly.DiscordEmbed()
      .setTitle('Help 🌐')
      .setColor('RANDOM')
      .addField('Moderation', "View moderation commands by doing: `help moderation`")
    button.channel.send(`Help is here :D`, {embeds: [helpEmbed]})
   }
})


client.login('Your secret bot token.')

FAQs

Package last updated on 05 Feb 2022

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