Code Monkey home page Code Monkey logo

discord-nft-sales-bot's Introduction

NFT sales Discord Bot

An open source NFT sales bot for Discord.

This bot was created for the Pixelglyph Discord Server as part of the Pixelglyph DAO.

Pixelglyph

This bot was inspired by 0xEssential's OpenSea Discord Bot. Rather than polling OpenSea APIs, this package sets up an event listener and listens to transfer events directly from the blockchain and posts to a specified channel in your Discord server. It supports ETH and WETH sales.

Creating a bot

See the https://github.com/0xEssential/opensea-discord-bot README for a good explanation of setting up your bot in the Discord developer portal.


This package requires Node 16.6.0 or greater


Installation

yarn install discord-nft-sales-bot

Usage

Simple example:

import nftSalesBot from "discord-nft-sales-bot";

nftSalesBot({
  // Websocket connection to Ethereum)
  websocketURI: process.env.WEBSOCKET_URI,

  // NFT smart contract address
  contractAddress: process.env.CONTRACT_ADDRESS,

  // Bot token set up in Discord developer portal
  discordBotToken: process.env.DISCORD_BOT_TOKEN,

  // ID of channel (turn on Developer mode in Discord to get this)
  discordChannelId: process.env.DISCORD_CHANNEL_ID,
}).catch((e) => {
  // something went wrong
});

Options

The default export takes one argument which is an object with the following keys and values:

  • websocketURI - Required. This is a websocket connection to Ethereum. You can easily get one of these by signing up for Infura.
  • contractAddress - Required. The smart contract address for your ERC-721 smart contract.
  • discordBotToken - Required. The Discord bot token for you bot. Create an application within the Discord developer portal and then create a bot within that application that can has permissions to post messages. You can reveal the token from the bot screen.
  • discordChannelId - Required. The ID of the channel you want to bot to post in. You can get this by turning on Developer mode in Discord and then clicking the settings icon of the channel.
  • metadataCb - Optional. A function that receives the raw NFT metadata as the first argument. Must return an object of the following type { name: string; image: string }

discord-nft-sales-bot's People

Contributors

0xdeployer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.