mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-08 06:47:56 +00:00
better parameters handling, implement import export
This commit is contained in:
parent
e4f38c76a9
commit
5198f7d83b
19 changed files with 250 additions and 174 deletions
|
|
@ -20,7 +20,7 @@ public static class ContextParametersExt
|
|||
);
|
||||
}
|
||||
|
||||
public static async Task<List<PKMember>> ParamResolveMembers(this Context ctx, string param_name)
|
||||
public static async Task<List<PKMember>?> ParamResolveMembers(this Context ctx, string param_name)
|
||||
{
|
||||
return await ctx.Parameters.ResolveParameter(
|
||||
ctx, param_name,
|
||||
|
|
@ -36,7 +36,7 @@ public static class ContextParametersExt
|
|||
);
|
||||
}
|
||||
|
||||
public static async Task<List<PKGroup>> ParamResolveGroups(this Context ctx, string param_name)
|
||||
public static async Task<List<PKGroup>?> ParamResolveGroups(this Context ctx, string param_name)
|
||||
{
|
||||
return await ctx.Parameters.ResolveParameter(
|
||||
ctx, param_name,
|
||||
|
|
|
|||
|
|
@ -126,6 +126,8 @@ public class Parameters
|
|||
return new Parameter.ChannelRef(await ctx.Rest.GetChannelOrNull(channelId) ?? throw new PKError($"Channel {channelId} not found"));
|
||||
case uniffi.commands.Parameter.GuildRef(var guildId):
|
||||
return new Parameter.GuildRef(await ctx.Rest.GetGuildOrNull(guildId) ?? throw new PKError($"Guild {guildId} not found"));
|
||||
case uniffi.commands.Parameter.Null:
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue