-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement AMA bot from https://github.com/NoComment1105/cozy-ama #71
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good, but a couple small things stick out
module-ama/src/main/kotlin/org/quiltmc/community/cozy/modules/ama/AmaExtension.kt
Outdated
Show resolved
Hide resolved
module-ama/src/main/kotlin/org/quiltmc/community/cozy/modules/ama/_Utils.kt
Outdated
Show resolved
Hide resolved
I was able to test and have since done so and fixed a couple of issues i found. All is ready for review |
module-ama/src/main/kotlin/org/quiltmc/community/cozy/modules/ama/_Utils.kt
Outdated
Show resolved
Hide resolved
import dev.kord.common.entity.Snowflake | ||
|
||
public class MemoryAmaData : AmaData { | ||
private val ama: MutableList<AmaConfig> = mutableListOf() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: might it be reasonable to instead use a map here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since configs are only referenced by guild ID, it could give a slight speedup. It also fixes a potential bug: currently any changes caused by running setConfig
will be entirely ignored as only the first matching item is chosen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be a guildId
to AmaConfig
map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, did a quick test and appears to function correctly, haven't tested scenarios where bot is misconfigured.
Just talked about this in AMA chat but this currently has no support for plural kit. It sounds like it would not be feasible to add and have it work properly however should an optional name field be added to the ask modal so that people part of plural systems can have their name shown in the question. |
# Conflicts: # .idea/modules.xml # src/main/kotlin/org/quiltmc/community/database/migrations/v22.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once you get the Pluralkit integration I think this will be great!
|
||
if (config == null) { | ||
respond { | ||
content = "There is no AMA config for this guild!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe print the command to set the config?
|
||
check { | ||
anyGuild() | ||
hasPermission(Permission.ManageGuild) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this allow event team members to start the AMA?
import dev.kord.common.entity.Snowflake | ||
|
||
public class MemoryAmaData : AmaData { | ||
private val ama: MutableList<AmaConfig> = mutableListOf() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be a guildId
to AmaConfig
map
Untested locally due to discord not updating my bots commands, hopefully someone else can see if it works?
EDIT: It was rate limiting please holdEDIT 2: Nevermind it just won't start plz help