-
-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9741415
commit 9a07589
Showing
21 changed files
with
1,676 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
...n/java/net/dv8tion/jda/api/events/interaction/component/EntitySelectInteractionEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright 2015 Austin Keener, Michael Ritter, Florian Spieß, and the JDA contributors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.dv8tion.jda.api.events.interaction.component; | ||
|
||
import net.dv8tion.jda.api.JDA; | ||
import net.dv8tion.jda.api.entities.IMentionable; | ||
import net.dv8tion.jda.api.entities.Mentions; | ||
import net.dv8tion.jda.api.interactions.components.selections.EntitySelectInteraction; | ||
import net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
/** | ||
* Indicates that a custom {@link EntitySelectMenu} on one of the bots messages was used by a user. | ||
* | ||
* <p>This fires when a user selects the options on one of the custom select menus attached to a bot or webhook message. | ||
* Use {@link #getMentions()} or {@link #getValues()} to handle the selected entities. | ||
* | ||
* <p><b>Requirements</b><br> | ||
* To receive these events, you must unset the <b>Interactions Endpoint URL</b> in your application dashboard. | ||
* You can simply remove the URL for this endpoint in your settings at the <a href="https://discord.com/developers/applications" target="_blank">Discord Developers Portal</a>. | ||
* | ||
* @see StringSelectInteractionEvent | ||
*/ | ||
public class EntitySelectInteractionEvent extends GenericSelectMenuInteractionEvent<IMentionable, EntitySelectMenu> implements EntitySelectInteraction | ||
{ | ||
private final EntitySelectInteraction interaction; | ||
|
||
public EntitySelectInteractionEvent(@Nonnull JDA api, long responseNumber, @Nonnull EntitySelectInteraction interaction) | ||
{ | ||
super(api, responseNumber, interaction); | ||
this.interaction = interaction; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public EntitySelectInteraction getInteraction() | ||
{ | ||
return this.interaction; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public Mentions getMentions() | ||
{ | ||
return interaction.getMentions(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...n/java/net/dv8tion/jda/api/events/interaction/component/StringSelectInteractionEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2015 Austin Keener, Michael Ritter, Florian Spieß, and the JDA contributors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.dv8tion.jda.api.events.interaction.component; | ||
|
||
import net.dv8tion.jda.api.JDA; | ||
import net.dv8tion.jda.api.interactions.components.selections.StringSelectInteraction; | ||
import net.dv8tion.jda.api.interactions.components.selections.StringSelectMenu; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
/** | ||
* Indicates that a custom {@link StringSelectMenu} on one of the bots messages was used by a user. | ||
* | ||
* <p>This fires when a user selects the options on one of the custom select menus attached to a bot or webhook message. | ||
* Use {@link #getValues()} or {@link #getSelectedOptions()} to handle the selected options. | ||
* | ||
* <p><b>Requirements</b><br> | ||
* To receive these events, you must unset the <b>Interactions Endpoint URL</b> in your application dashboard. | ||
* You can simply remove the URL for this endpoint in your settings at the <a href="https://discord.com/developers/applications" target="_blank">Discord Developers Portal</a>. | ||
* | ||
* @see EntitySelectInteractionEvent | ||
*/ | ||
public class StringSelectInteractionEvent extends GenericSelectMenuInteractionEvent<String, StringSelectMenu> implements StringSelectInteraction | ||
{ | ||
private final StringSelectInteraction interaction; | ||
|
||
public StringSelectInteractionEvent(@Nonnull JDA api, long responseNumber, @Nonnull StringSelectInteraction interaction) | ||
{ | ||
super(api, responseNumber, interaction); | ||
this.interaction = interaction; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public StringSelectInteraction getInteraction() | ||
{ | ||
return interaction; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
.../java/net/dv8tion/jda/api/interactions/components/selections/EntitySelectInteraction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2015 Austin Keener, Michael Ritter, Florian Spieß, and the JDA contributors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.dv8tion.jda.api.interactions.components.selections; | ||
|
||
import net.dv8tion.jda.api.entities.IMentionable; | ||
import net.dv8tion.jda.api.entities.Mentions; | ||
import net.dv8tion.jda.api.events.interaction.component.EntitySelectInteractionEvent; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
/** | ||
* Component Interaction for a {@link EntitySelectMenu}. | ||
* | ||
* @see EntitySelectInteractionEvent | ||
*/ | ||
public interface EntitySelectInteraction extends SelectMenuInteraction<IMentionable, EntitySelectMenu> | ||
{ | ||
/** | ||
* The resolved {@link Mentions} for this selection. | ||
* <br>This supports {@link Mentions#getRoles() roles}, {@link Mentions#getUsers() users}, and {@link Mentions#getChannels() channels}. | ||
* | ||
* @return The mentions | ||
*/ | ||
@Nonnull | ||
Mentions getMentions(); | ||
} |
Oops, something went wrong.