Community Antiabuse Discord Bot [Technical Overview]

in #antiabuse3 years ago

I was encouraged by @adamada to write a technical overview of the community anti-abuse discord bot in hopes that it will encourage other communities to build their own tools that may prove helpful in managing their respective communities.

Why did I build the bot

I was a Curie curator before. My co-curators then were major inspirations on creating this bot as I've mostly emulated and expanded from what they have already built -- not by using their code itself but by merely experiencing the utility and efficiency of a Discord bot that they created. It widened my perspective into how helpful a Discord bot can be within a thriving community. The bot was further shaped by @adamada and his creative efforts in battling platform abuse, and by the communities that I belonged to such as @hiveph and @tagalogtrail. I hope that by giving an overview of the components of the bot, other users would be able to build upon these ideas and create a much more efficient and functional version tailored for their communities.

A disclaimer

The next sections of this post would probably make zero sense to non-programmers (and apologies for that!), and at the same time, it isn't technical enough to sufficiently guide programmers. The succeeding content is mainly about ideas of how the bot operates and an overview of the components of the bot. But if you have done anything with Node.js, then I'm 99% sure this bot would be a walk in the park for you.



Bot Components

Discord.js

The primary component of the project that makes the bot function, Discord.js. The creators of the module have created an extensive guide on how to get started with your bot.

Once the bot is properly configured, you can have the bot respond to specific messages. The bot will "listen" to all conversations happening inside the Discord server, so it's up to us to set and filter which messages the bot will respond to.

For one of our bot's simple functions, I coded it to say a simple hello back to anyone who types in the text "!hello".

DiscordHello.png


HiveSQL

Saying hi is all good but it's not exactly helpful. The bot only becomes more relevant to Hive communities by using HiveSQL.

Blockchain data can be quite hard to access and interpret. But if you got any SQL background knowledge, then picking apart and gathering information from the entire Hive blockchain is fairly easy to do with the use of HiveSQL. And above all that, the creator, arcange, made it free for all Hive users.

Quoting from the HiveSQL website, "HiveSQL makes it possible to produce quick answers to complex questions." One of these complex questions was how do we check connections between seemingly unrelated user accounts. A suggestion was presented to track the token exchanges between users. HiveSQL made it easy to do that as seen from this sample screenshot.


screenshot image from Adamada's post


MongoDB

You got the bot working and you also have unrestricted access to Hive blockchain information. Now you could build your own information resource that will be relevant to you and your community's needs.

MongoDB is a document-oriented database. There are lots of other options to use as a database but I liked that it has MongoDB Atlas, a cloud service that provides convenient setup and deployment of your database. It's also possible to use it for free. A running theme for all the components I mentioned thus far -- free and easy to use!

@adamada specifically requested to have a reporting mechanism of user offenses which includes identity theft, plagiarism, etc. He also requested that the Discord users who reported the Hive blog post should be also be tracked. Our own database, powered by MongoDB Atlas, has enabled us to record all this information and more.


screenshot image from Adamada's post


To End

I know the information provided in this post is far from sufficient to actually help anyone to create their Discord bot. As with most endeavors, further research and study are required. My skills and experience as a programmer are fairly limited too, thus, making it much more difficult for me to translate my knowledge into writing. But that's a good point as well. Even with my limited skill set, I was able to create a functional prototype. It goes to show that with enough effort and minimal programming know-how, this Discord bot is very doable. If anyone would need further assistance, you can comment on this post or reach out on Discord. No promises if I could be really helpful, but I'll share what I can :)

Sort:  

There is so much more to learn and dive into. Simply amazing coming from an amateur like me yet the concept was quite cool I must say. Programming has so much more into it than what meets the eye.

yes, discord bots are fun and fairly simple to do. I hope you'll be able to experiment within your Discord community. cheers!

This is but a step into further decentralisation and efficiency.

Thank you for taking the time to build this.

thanks for the acknowledgement! I'm just glad I was able to somehow help out the community behind the scenes even if I was mostly absent on the blogging side of Hive.

If anyone would need further assistance, you can comment on this post or reach out on Discord. No promises if I could be really helpful, but I'll share what I can :)

I need help... Just kidding.

Thank you Jazz for your efforts and continuous improvement in the community. You are well appreciated by the surviving folks around the group.

thanks for the nice words, TP! the bot's first version was used in @tagalogtrail, so I (and probably the bot too) is grateful to you and Tagalogtrail community.

This is a big help to communities interested in automating their anti-abuse campaign. It's a step further in pushing for original content. Congrats and thanks. !LUV

thanks for the support!

Welcome, @jazzhero. Good job on your part. :)

<><

<><

LUV

Connect

Trade


@jazzhero, you've been given LUV from @juanvegetarian.

Check the LUV in your H-E wallet. (1/1)

Congratulations @jazzhero! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

You distributed more than 31000 upvotes.
Your next target is to reach 32000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!