53 lines
2.5 KiB
Java
53 lines
2.5 KiB
Java
package com.discord.widgets.chat.list.sheet;
|
|
|
|
import com.discord.api.commands.ApplicationCommandData;
|
|
import com.discord.api.commands.ApplicationCommandValue;
|
|
import com.discord.widgets.chat.list.sheet.WidgetApplicationCommandBottomSheetViewModel;
|
|
import d0.t.u;
|
|
import d0.z.d.m;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
/* compiled from: WidgetApplicationCommandBottomSheet.kt */
|
|
public final class WidgetApplicationCommandBottomSheetKt {
|
|
public static final String toSlashCommandCopyString(ApplicationCommandData applicationCommandData, Map<String, WidgetApplicationCommandBottomSheetViewModel.SlashCommandParam> map) {
|
|
String str;
|
|
m.checkNotNullParameter(applicationCommandData, "$this$toSlashCommandCopyString");
|
|
m.checkNotNullParameter(map, "commandValues");
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append('/');
|
|
sb.append(applicationCommandData.a());
|
|
sb.append(' ');
|
|
List<ApplicationCommandValue> b = applicationCommandData.b();
|
|
if (b == null || (str = u.joinToString$default(b, " ", null, null, 0, null, new WidgetApplicationCommandBottomSheetKt$toSlashCommandCopyString$1(map), 30, null)) == null) {
|
|
str = "";
|
|
}
|
|
sb.append(str);
|
|
return sb.toString();
|
|
}
|
|
|
|
public static final String toSlashCommandCopyString(ApplicationCommandValue applicationCommandValue, Map<String, WidgetApplicationCommandBottomSheetViewModel.SlashCommandParam> map) {
|
|
m.checkNotNullParameter(applicationCommandValue, "$this$toSlashCommandCopyString");
|
|
m.checkNotNullParameter(map, "commandValues");
|
|
String str = null;
|
|
if (applicationCommandValue.b() != null) {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(applicationCommandValue.a());
|
|
sb.append(' ');
|
|
List<ApplicationCommandValue> b = applicationCommandValue.b();
|
|
if (b != null) {
|
|
str = u.joinToString$default(b, " ", null, null, 0, null, new WidgetApplicationCommandBottomSheetKt$toSlashCommandCopyString$2(map), 30, null);
|
|
}
|
|
sb.append(str);
|
|
return sb.toString();
|
|
}
|
|
StringBuilder sb2 = new StringBuilder();
|
|
sb2.append(applicationCommandValue.a());
|
|
sb2.append(':');
|
|
WidgetApplicationCommandBottomSheetViewModel.SlashCommandParam slashCommandParam = map.get(applicationCommandValue.a());
|
|
if (slashCommandParam != null) {
|
|
str = slashCommandParam.getCopyText();
|
|
}
|
|
sb2.append(str);
|
|
return sb2.toString();
|
|
}
|
|
}
|