Skip to content
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

Closed
wants to merge 9 commits into from

Conversation

NoComment1105
Copy link
Contributor

@NoComment1105 NoComment1105 commented Mar 31, 2023

Untested locally due to discord not updating my bots commands, hopefully someone else can see if it works?

EDIT: It was rate limiting please hold
EDIT 2: Nevermind it just won't start plz help

Copy link
Member

@sschr15 sschr15 left a 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

@sschr15 sschr15 requested a review from gdude2002 April 1, 2023 20:28
@NoComment1105
Copy link
Contributor Author

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/build.gradle.kts Outdated Show resolved Hide resolved
import dev.kord.common.entity.Snowflake

public class MemoryAmaData : AmaData {
private val ama: MutableList<AmaConfig> = mutableListOf()
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member

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

Copy link
Member

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

Copy link

@ghost ghost left a 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.

@ghost
Copy link

ghost commented May 6, 2023

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.

Here's a little bit of a bad mockup:
image

@sschr15
Copy link
Member

sschr15 commented May 6, 2023

Ladysnake's fork of Cozy does this for suggestion submissions:

Modal text box called "PluralKit Member ID"

A similar feature could be made for the AMA modal

# Conflicts:
#	.idea/modules.xml
#	src/main/kotlin/org/quiltmc/community/database/migrations/v22.kt
Copy link
Member

@OroArmor OroArmor left a 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!"
Copy link
Member

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)
Copy link
Member

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()
Copy link
Member

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

@sschr15 sschr15 removed the request for review from gdude2002 July 25, 2023 03:32
@sschr15 sschr15 mentioned this pull request Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants