Here are the major changes and new features I made to DiscoSteem-Bot. In this post you will find information about all changes and how to implement the new features.
- Now you can retrieve all the items of your choice according to the tags you have chosen and you can display them on a specific channel on your Discord server.
- You can search for several articles by an author containing a tag of your choice.
- The $bal-sbd and $bal-steem commands have been removed and now you can find all this information with the $bal command
- The layout of the links displayed on the Discord server has been improved.
About the new features
I've added a very useful feature for all Community Discord servers. The new function allows you to retrieve the articles posted on Steem's block string according to the tags you have chosen.
The items are sent to the channels you have selected and configured in the configuration file. Json. Thanks to this tool, I can now display on my server all the articles posted on the Steem blocks chain that contain #fr and #dtube for example.
I have also removed unnecessary functions, such as bal-sbd, bal-steem, which I have grouped into the bal function and which now displays all the necessary information.
A search function has also been added. It allows you to retrieve an author's articles from a specific tag. The search can be done on the last 100 articles of an author.
Stream function overview
$search command overview
$bal command overview
I decided to change the complete structure of my code. You can notice the addition of an actions/ folder that contains all the functions that recover data on the Steem blockchain. Functions that process code received from Discord are processed in the file cmd-bot.js. (View cmd-bot.js on Github)
By doing so, I can reuse the functions available in actions/ folder, to create new features. Creating new features is easier to implement and the code is much easier to explore. (View actions/ folder on Github)
The file cmd-bot.js contains the functions called by app. js. The functions of *cmd-bot.js trigger the functions contained in the actions/ folder. (View app.js on Github)
For the Stream function, I chose to modify the config.json file by adding the values: "altTags, principalTag, principalChan and maintenance."
The stream function is triggered in the app. js file as soon as the bot is turned on. It calls directly the streamOp function located in actions/streamOp.js which itself calls the getContent function located in actions/content.js. (View content.js on Github)
streamOp. js contains the stream function and content. js searches through the SteemJS API based on the results obtained by the stream function. (View streamOp.js on Github)
The function that filters items depends on the settings in the config.js file. In order for the bot to work properly, you must retrieve the IDs of the channels you want and assign them to the correct tag in the config.json file. (View config.json on GIthub)
- Improved code readability
- Add page layout of the created and search functions
- Create a voting function for the administrator
- Automatic messages on different social networks
Don't hesitate to contact me on Discord or Github if you would like to contribute to the project or if you need help setting up the bot.
Posted on Utopian.io - Rewarding Open Source Contributors