minehut utils banner

minehut utils

1 devlog
5h 53m 19s

on open source contribution on a discord moderation bot to implement stickied messages. stickied messages are messages that persist at the bottom of the channel/feed/etc in the hopes that they are read :)

Demo Repository

Loading README...

derek

Shipped this project!

Hours: 5.89
Cookies: 🍪 46
Multiplier: 7.8 cookies/hr

pretty straightforward implementation of sticky messages with kotlin, a language that is still pretty new to me. generally, I think it well, ran into some issues surrounding the flow of setting a message / updating it after starting a message (and also error handling since, originally if you manually deleted the message before the bot updated it it would just…. fail in the coroutine and never post a new one woopsy!)

derek

the goal of this feature was to be able to sticky messages in channels on discord, for security concerns we weren’t able to add another discord bot but, we wanted to add it to our internally maintained discord bot

what are sticky messages?
they are messages that are constantly bumped to the bottom of the feed within channels, so that hopefully people won’t miss them!

branch diff against upstream: https://github.com/SantioMC/MinehutUtils/compare/master...DDbrother9999:MinehutUtils:feat/starlight/sticky

  • features -
    sticky command
  • subcommand start -> starts stickying a message
  • subcommand set -> sets the stickied message (or updates it)
  • subcommand stop -> stops stickying a message

manager

  • kotlin coroutines to check for messages and update them only if the last message in a channel was not the message (we want to try to limit the number of updates, and optimize where possible)

logging

  • using internal logging, to log actions in a designated channel

comments / lint

  • repository guidelines, etc

this was my first time using kotlin, from developing in java so managing null values explicitly was something new for me

Attachment
Attachment
0