GithubHelp home page GithubHelp logo

hyacinthbots / lilybot Goto Github PK

View Code? Open in Web Editor NEW
69.0 1.0 24.0 3.47 MB

LilyBot, a multi-purpose bot for discord!

Home Page: https://hyacinthbots.org

License: GNU General Public License v3.0

Kotlin 99.32% Dockerfile 0.12% Shell 0.56%
discord-bot bot discord kotlin kord kordex lilybot

lilybot's Introduction

LilyBot

The LilyBot Logo

GitHub Workflow Status GitHub Workflow Status

GitHub issues GitHub pull requests

GitHub GitHub repo size

GitHub commits since latest release GitHub commit activity

About

LilyBot, or Lily, is a multipurpose Discord bot. Lily handles moderation, utility, link filtering, and much, much more. Lily is canonically transfem and uses she/her or it/its pronouns.

Usage

If you're looking to add Lily to your server, you don't need any of this and can simply click this link.

If you need additional instruction using up the public instance of Lily, try our usage guide.

If you're looking to set up a development environment for Lily, try our development guide.

Links

Tooling

Lily makes use of the following tools and frameworks.

  • Kord, the Kotlin API for Discord.
  • KordEx, an integrated commands and extensions framework for Kord.
  • KordEx's Phishing, PluralKit, Unsafe and Welcome Channel modules.
  • MongoDB and KMongo to manage the database.
  • Logback, a library that makes logging prettier
  • Kotlin Logging, a lightweight logging that wraps SLF4J with kotlin extensions
  • Github-API, the API utilized by the GitHub commands
  • Shadow Gradle Plugin, a tool which allows us to make a big fatjar containing all dependencies
  • detekt, a static code analysis tool for the Kotlin programming language. This helps us keep our code clean and nicely formatted.
  • Doc-generator, our in-house documentation generator for KordEx bots

Contributing

This repository is open to contributions by the community. If you plan on contributing, please check our Contributor Guidelines.

These days, Lily is primarily developed by NoComment and tempest15. To discuss development with us, join the Discord linked above.

Contributors

GitHub contributors contributors

lilybot's People

Contributors

akarys42 avatar alsosylv avatar altrisi avatar ampflower avatar chxlky avatar deepsourcebot avatar dependabot[bot] avatar ellieisjelly avatar ember-ruby avatar foundationgames avatar gdude2002 avatar henkelmax avatar ims212 avatar jcryer avatar justsnoopy30 avatar lizistired avatar maximumpower55 avatar misscorruption avatar nocomment1105 avatar notjansel avatar osfanbuff63 avatar ruthenic avatar tempest15 avatar trainb0y avatar woodiertexas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lilybot's Issues

Automatically add an arbitrary role to a thread

Is your feature request related to a problem? Please describe.
I run a server with various ongoing projects and have people rarely participate in them because they are in threads.

Describe the solution you'd like
The ability to add any arbitrary role to a thread, ideally without pinging the role.

Describe alternatives you've considered

  • Waiting for Discord's forums feature
  • Manually adding people
  • Doing nothing (current solution)

The role menu system needs a rewrite

The current system is poorly designed and written. It's also quite likely not properly adapted to Lily being cross-guild. It needs a full rewrite, likely using a dropdown so multiple roles can be selected from one menu.

It should be possible to lock only a single thread

Currently if the lock channel command is run in a thread, the parent channel will be locked. There should be a way to lock threads. This might need to be a separate lock thread sub command, but I haven't done enough research to be sure of that.

Certain things need inGuild checks to prevent errors in DM's

What happened?

When running certain commands in DM's with the bot, it simply errors due to the guild being null. Lily should catch this print a subsequent error. This could be an avenue for @Miss-Corruption's suggested Exceptions that can be found here

Screenshots

image

Relevant log output

java.lang.NullPointerException: null
	at net.irisshaders.lilybot.utils._UtilsKt.getConfigPublicResponse(_Utils.kt:41)
	at net.irisshaders.lilybot.extensions.util.PublicUtilities$setup$3$2$1.invokeSuspend(PublicUtilities.kt:88)
	at net.irisshaders.lilybot.extensions.util.PublicUtilities$setup$3$2$1.invoke(PublicUtilities.kt)
	at net.irisshaders.lilybot.extensions.util.PublicUtilities$setup$3$2$1.invoke(PublicUtilities.kt)
	at com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSlashCommand.run(EphemeralSlashCommand.kt:119)
	at com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSlashCommand$run$1.invokeSuspend(EphemeralSlashCommand.kt)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147)
	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15)
	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147)
	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15)
	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147)
	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15)
	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147)
	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15)
	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
	at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:191)
	at io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:147)
	at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:15)
	at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:93)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

LilyBot Version

All versions

Additional context

No response

Log uploading has no error handling

There's currently just a try/catch that swallows any errors. It'd be much better to catch errors and then respond in some way, most likely by updating the embed and outputting the stacktrace.

Automatic cleanup of "User started thread" messages

Is your feature request related to a problem? Please describe.
These types of messages only serve to clutter up a channel.

Describe the solution you'd like
Lily detects these messages and deletes them.

Describe alternatives you've considered
The messages have to be manually deleted.

Additional context
image

Thread archiving has issues

What happened?

  • Using /thread archive on a thread should also remove the prevent-archiving protection if present, but it doesn't
  • The message for disabling thread archiving says Thread archiving enabled!

Screenshots


Relevant log output

No response

LilyBot Version

No response

Additional context

No response

An option to allow for public, in-channel logging of moderation actions

Some other moderation focused bots, e.g. Zeppelin, have public responses to moderation commands. This informs any users in the conversation of the actions taken. For some communities, this is preferred, so Lily should have an option to support it.

The easiest way to do this that I can think of is to make a copy, possibly with slightly less information, of the logging embed and send it in the channel. Shenanigans with public responses might also be an option. Ephemeral moderation should remain default.

Join And Leave Messages

Is your feature request related to a problem? Please describe.
I want to have join messages on my server, but I don't want to use the built in ones which Discord provides, since they look "unprofessional" and can be deleted by the user. Discord also does not provide any leave messages.

Describe the solution you'd like
I would like a system which lets me create my own join and leave messages, with a few additional features:

  • Have a customizable random set of join / leave messages to choose from. Like Discord's messages.
  • Optionally use embeds.
  • Optionally use a "quiet mode" where join messages have a short delay and are not sent if the user immediately leaves after joining a server.
    • Don't send leave messages if the user did not send any messages while they were on the server.
  • Handle bots specially and do not send join or leave messages for them.

Describe alternatives you've considered
It is possible to send join logs to a public channel, but not very clean. The feature could also be implemented very simply without the extra things I've suggested.

Allow non-sensitive config options to be changed by the `Manage Server` permission

It doesn't make sense to require administrator perms for a lot of the config options (or really any of them). Almost all of GiselleBot's options can be configured by a server manager, and that is the permission gate for most of Discord's options, like changing the server name or icon. It doesn't make too much sense that a server manager can change the server name and icon but not where messages are logged, for example.

Document uploading includes images

Lily automatically uploads .txt file to hastebin, but she also uploads images when images are attached alongside .txt files, I believe this is an error because images uploaded to hastebin look like the following:
image

File uploading in support channels

When a log is sent as the first message of a thread in a support channel, Lily places the "Would you like to upload" dialog outside the thread.

Does not reapply mute role on rejoining

When leaving and rejoining the server, the muted role is not applied for active mutes.

Suggested fix

Add an event listener to member join event on JDA and check against list of active mutes

Add a way to customize the role that is pinged in thread creation

Is your feature request related to a problem? Please describe.
None.

Describe the solution you'd like
Lily should open a thread on creation and write a message (can be edited by the server staff) in said thread and edit in a specified role ping.

Describe alternatives you've considered
None.

Additional context
Basically what Cozy does in the Quilt discord.

Lily should have a command for users to request nicknames

Iris's discord has nickname permissions off to prevent hoisting, general trolling, or offensive names. As a result, users must manually request nicknames from moderators, and there's no clear way for this to be done. This command would solve that issue.

The vision is that a user would simply run the command with their requested nick. Lily would then create a message in the mod action log with a confirm/deny button. Mods could then simply press the button and Lily will nick the person, dm them, and auto-update the message.

Lily doesn't show who created a role menu

What happened?

The Logs for creating a role menu don't show who created it

Screenshots

Screenshot from 2022-07-27 03-20-53

Relevant log output

No response

LilyBot Version

No response

Additional context

No response

We should stop casting channels

Casting channels is generally not a great thing to do apparently. The preferred way to do the same thing is asChannelOf<channelType>() Someone needs to go through every as channelType and replace it with an asChannelOf<channelType>()

Data from guilds Lily has left is kept forever

This data should be deleted when Lily leaves a guild. Holding onto it both uses database space and holds onto user data for no reason. There should probably be some sort of safety system so an accidental kick doesn't wipe all the guild's tags. A DM to the owner, if possible, would work well.

Race condition on command registration

JDA Chewtils only cares about slash commands before the onReady event. If onReady is called before Lily has finished registering commands, the ones left won't be registered (this is unlikely to happen since there's network, discord and more, but I think possible).

https://github.com/Chew/JDA-Chewtils/blob/21f7efbdb58a5571edc09b622fc06e8831803020/command/src/main/java/com/jagrosh/jdautilities/command/impl/CommandClientImpl.java#L580-L602 is the only reference to slashCommands, and that's the only thing that addSlashCommand touches (https://github.com/Chew/JDA-Chewtils/blob/21f7efbdb58a5571edc09b622fc06e8831803020/command/src/main/java/com/jagrosh/jdautilities/command/impl/CommandClientImpl.java#L346)

A fix for this may be adding slash commands before building the CommandClient, assuming the ReadyEvent can't come before it's built. Else it's not even Lily's bug.

Another fix is sending the slash commands to discord manually, as it's called in the lib. That would also allow creating, editing and deleting commands at runtime (see https://github.com/altrisi/LilyBot/blob/a0537320e341962bb6c1fc463f356f01d7eee565/src/main/java/net/irisshaders/lilybot/commands/custom/CustomCreator.java for an example of how adding could work). But the editing and deleting part is more complicated to handle, since the maps/lists aren't exposed.

Log more stuff such as role creations/deletions/edits/etc

Is your feature request related to a problem? Please describe.
Lilybot only has modlogs, message logs and member join/leave logs.

Describe the solution you'd like
Lilybot should log things like role creations/deletions/assignments/edits, channel creations/deletions/edits, and bot additions/removals.

Describe alternatives you've considered
I used dynobot for the extra logging it had before switching to lilybot.

Additional context
None.

Ability to edit /say messages

Title says it all. May be difficult to deal with embeds...

Alternative to this is to create a welcome channel system using Cozy's welcome channel module, perhaps

Support threads need a better naming system

Currently, they're just named after the user. While occasionally helpful, being able to see at a glance what threads are would be quite useful. Some sort of system that parses the message and names the thread accordingly, while also encouraging the user to give it a better name, would be quite useful.

We need a way to migrate databases

When the database format for something is updated, we currently have no solution for migrating it. We write a bad startup hook and then revert the commit before release. See #177 for example. We need to come up with a more permanent solution for this.

Lily doesn't check permissions before sending messages

Lily doesn't check if she has permission to send a message in a channel before sending it. Alternatively, we don't catch this error. The major culprit I see is the response helper, but I'm sure there are other locations.

Config option to customise support message

The first message in support threads is always something along the lines of "@user, please wait for the @support role to get back to you!" This is not always suitable, so a config option to change this would be quite nice.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.