Skip to content

Commit

Permalink
renames: mention methods to appropriate, non-conflicting names
Browse files Browse the repository at this point in the history
  • Loading branch information
ShindouMihou committed Feb 17, 2023
1 parent f0fbdcd commit bd28fdd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ interface NexusCommandManager {
*/
fun index(applicationCommand: ApplicationCommand)

fun mention(server: Long?, vararg commands: String) = indexStore.mention(server, *commands)
fun mention(server: Long?, command: String) = indexStore.mention(server, command)
fun mentionMany(server: Long?, vararg commands: String) =
indexStore.mentionMany(server, *commands)
fun mentionOne(server: Long?, command: String, override: String? = null, default: String) =
indexStore.mentionOne(server, command, override, default)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package pw.mihou.nexus.core.managers.indexes

import pw.mihou.nexus.core.managers.records.NexusMetaIndex
import pw.mihou.nexus.features.command.annotation.IdentifiableAs

interface IndexStore {

Expand Down Expand Up @@ -35,7 +34,7 @@ interface IndexStore {
* @param default the default value to use when there is no command like that.
* @return the mention tags of the command.
*/
fun mention(server: Long?, command: String, override: String? = null, default: String): String {
fun mentionOne(server: Long?, command: String, override: String? = null, default: String): String {
val index = get(command, server) ?: return default
return "</${override ?: index.command}:${index.applicationCommandId}>"
}
Expand All @@ -46,7 +45,7 @@ interface IndexStore {
* @param names the names of the commands to fetch.
* @return the mention tags of each commands.
*/
fun mention(server: Long?, vararg names: String): Map<String, String> {
fun mentionMany(server: Long?, vararg names: String): Map<String, String> {
val indexes = many(server, *names)
val map = mutableMapOf<String, String>()
for (index in indexes) {
Expand Down

0 comments on commit bd28fdd

Please sign in to comment.