DiscoSteem-Bot update - New features to animate your Discord server

in utopian-io •  9 months ago

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.

discosteem-bot-v2.png

New Features

  1. 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.
  2. You can search for several articles by an author containing a tag of your choice.
  3. The $bal-sbd and $bal-steem commands have been removed and now you can find all this information with the $bal command
  4. 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.

For example by choosing the #fr main tag I can retrieve directly on my Discord server the articles that contain the #fr tag and also a series of alternative tags that allow to refine the search.

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.

Application Overview


Stream function overview

DiscoSteem-Capture1.png


$search command overview

test bot2.png


$last-post overview

test bot3.png


$bal command overview

test bot 4.png

Implementation


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)

You can see here all the files added during this update.

Next steps


  • 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

Contribution


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

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Super boulot tout ça !

·

:-) Merci beaucoup @dreamdev ! Mais je vais quand même tenter de m'améliorer encore avec un peu de temps et de travail !

je découvre que tu fais tout ça :) bon note bien que ça me dépasse techniquement, ce qui m'en rend que plus admiratif :)

·

Cool merci pour ton commentaire @vincentleroy c'est déprimant de ne pas pouvoir poster ça avec le #fr :-) donc ça fait vraiment plaisir que tu passes !

Je me dépatouille comme je peux, mais bon j'ai encore du pain sur la planche pour tenir la route ! En tous cas j'espère que ça servira à du monde. Déjà @zonguin est de la partie avec son serveur Discord et on verra pour celui de @francosteemvotes si @ixindamix est go pour l'inviter ;-) !

Si tu veux le tester tu es le bienvenu sur mon serveur le lien est sur mon profil au cas ou !

A bientôt !

Ok c'est clairement un truc que j'ajoute sur ma TODO de me pencher sur ces bots et faire mumuse avec :)
(merci la fonction save de @busy ;) )

·

héhé merci beaucoup @pl4m0re ! N'hésite surtout pas si tu as besoin de conseil pour commencer, tu verras c'est vraiment pas sorcier au final et surtout ça vaut le coup de mettre les mains dans le cambouis, ne serait-ce que pour se familiariser avec le truc.

·
·

Merci ! J'ai déjà plein de trucs à faire en ce moment, mais quand je me pencherai dessus je n'hésiterai pas à te contacter :)

Thank you for the contribution. It has been approved.

You can contact us on Discord.

[utopian-moderator]

·

Thanks for the review :-) !

Woop Wopp ! Super fier ! Dire que tu t'entrainais dans le Discord à l'époque héhé.
Je suis à des années lumières de ton niveau. Mais sache que j'ai commencé le Python il y a peu et que c'est bien cool d'essayer de programmer :D.
A plus !

·

:-) T'as vu ça, ça commence à prendre vie petit à petit ! Oui je me souviens que tu devais te lancer dans la programmation avec Python. Alors ça te plait ? Tu nous prépare quoi de beau ? C'est top Python pour développer des app Steem.

Courage pour la suite, je suis une quiche en Python donc compte pas sur moi pour t'aider à ce niveau là mais pour le reste tu peux toujours me poke quand tu le sens ;-) !

Merci d'être passé et à bientôt !

Hey @planetenamek I am @utopian-io. I have just upvoted you!

Achievements

  • You are generating more rewards than average for this category. Super!;)
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x