Nightshade

Random Mute Bot

The random mute bot is a Discord bot where the main feature is that it has a 50% chance to mute a member of the server whenever they send a message. This bot generally is made to make people feel the "highs" of engaging with risk. This bot also comes with an economy and a stats system with it as to reward people for sucessfully not being muted when their message is sent


Features

  • Randomly muting people on a 50% chance
  • Economy
  • Statistics

Technical details

This bot is written using Typescript then compiled into Javascript before runtime. Additionally, this bot also engages with Docker & Docker Compose to provide a full stack of tools including the bot itself as well as a MongoDB database server.

The main template of the bot simply uses the Touch Grass bot's code which is explained in more detail here. There isn't really much added on top of it. All that is different is that the messageCreate event handler listens for the event of a message being created, checks if a random value is above 0.50 and if it is true, it gets the member's ID and sends them into timeout using discord's timeout feature. Else, if it isn't true, it just gets the Member's ID and increases their currency counter by 1.

The MongoDB profile schema has only a few elements within it, totalMessagesSent, totalMutes, coins. totalMessagesSent always increments by 1 when a message is sent in a channel that the bot can see in. totalMutes increments by 1 whenever the afformentioned random check is true. coins increments by 1 whenever the afformentioned random check is false.