Giter Site home page Giter Site logo

lwf-discordbot's Introduction

DiscordBot API Scripts for Delegate and Voter Messages

A set of algorithms to analyze the LWF blockchain and provide Discord messages.

Notifications

  • Missed Blocks
  • Wallet Offline (In Development)
  • Potential Fork in a Core Node (In Development)
  • Network Consensus Below Threshold (In Development)

Responses

  • info ([subcommand]) - Returns useful information.
  • price ([coin name]) ([currency]) - Retrieves price data for the specified coin. Defaults to LWF and USD.
  • delegate ([username] or [rank]) - Provides information of a delegate. Defaults to rank 201.
  • rednodes (mainnet/testnet) - Lists delegates that are currently missing blocks. Defaults to mainnet.
  • snapshot (mainnet/testnet) - Show checksum for latest snapshot. Defaults to mainnet.
  • height (mainnet/testnet) - Provides the current height accross mainnet or testnet nodes. Defaults to mainnet.

Installation

Linux Ubuntu 16.10 and greater

git clone https://github.com/DEADP0OL/LWF-DiscordBot

cd LWF-DiscordBot

sudo apt-get install python3-pip

sudo pip3 install setuptools

sudo pip3 install requests

sudo pip3 install pandas

sudo pip3 install discord.py

Configuration

Copy default discord config.

cp configs/default_discord.json configs/discord.json

Edit the active config file.

nano configs/discord.json

  • apitoken: The apitoken assigned to your bot
  • blockinterval: The number of consecutive missed blocks required to reissue a notifications
  • minmissedblocks: The number of consecutive missed blocks required for an initial notification
  • numdelegates: The number of forging delegates on the blockchain
  • notificationmins: The number of minutes to update delegate information for mainnet and testnet
  • commandprefix: The character prefix for each bot function for the bot to listen for
  • bot_server: The discord server to use for notifications and responses
  • listen_channels: The discord server to use for notifications and responses
  • elevatedperms: A list of permission groups to have full bot permissions
  • msglenlimit: The character limit for messages on the discord server
  • priceurl: The api url to obtain price data

Activation

Start the python script.

cd LWF-DiscordBot

./lwf-discordbot.py

To keep the python script running after closing the terminal run the following command.

nohup ./lwf-discordbot.sh &

To end the python script run the following command.

pkill -f lwf-discordbot

lwf-discordbot's People

Contributors

deadp0ol avatar sgessa avatar

Watchers

James Cloos avatar seatrips 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.