From fdf20f591cdf2d61bdbc24c3625d619611cb1c5e Mon Sep 17 00:00:00 2001
From: Cenk Ergen <57065323+Cenngo@users.noreply.github.com>
Date: Sun, 13 Feb 2022 16:31:32 +0300
Subject: [PATCH] rename serilazation method
---
src/Discord.Net.Interactions/InteractionService.cs | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/Discord.Net.Interactions/InteractionService.cs b/src/Discord.Net.Interactions/InteractionService.cs
index c1291bd6b..f8202096f 100644
--- a/src/Discord.Net.Interactions/InteractionService.cs
+++ b/src/Discord.Net.Interactions/InteractionService.cs
@@ -854,8 +854,17 @@ namespace Discord.Interactions
if (!constraints.Any(x => x.IsAssignableFrom(targetType)))
throw new InvalidOperationException($"This generic class does not support type {targetType.FullName}");
- _genericTypeConverters[targetType] = converterType;
- }
+ ///
+ /// Serialize an object using a into a to be placed in a Component CustomId.
+ ///
+ /// Type of the object to be serialized.
+ /// Object to be serialized.
+ /// Services that will be passed on to the TypeReader.
+ ///
+ /// A task representing the conversion process. The task result contains the result of the conversion.
+ ///
+ public Task SerializeValueAsync(T obj, IServiceProvider services = null) =>
+ _typeReaderMap.Get(typeof(T), services).SerializeAsync(obj);
///
/// Loads and caches an for the provided .