diff --git a/src/Discord.Net.Commands/CommandService.cs b/src/Discord.Net.Commands/CommandService.cs index 7c7cdf7c5..c880dd454 100644 --- a/src/Discord.Net.Commands/CommandService.cs +++ b/src/Discord.Net.Commands/CommandService.cs @@ -235,7 +235,8 @@ namespace Discord.Commands public void AddTypeReader(Type type, TypeReader reader) { if (_defaultTypeReaders.ContainsKey(type)) - _cmdLogger.WarningAsync($"The default TypeReader for {type.FullName} was replaced by {reader.GetType().FullName}. To suppress this message, use the overload that has a Boolean to replace the default one and pass true.").GetAwaiter().GetResult(); + _ = _cmdLogger.WarningAsync($"The default TypeReader for {type.FullName} was replaced by {reader.GetType().FullName}." + + $"To suppress this message, use AddTypeReader(reader, true)."); AddTypeReader(type, reader, true); } /// @@ -244,19 +245,19 @@ namespace Discord.Commands /// /// The object type to be read by the . /// An instance of the to be added. - /// If should replace the default for if one exists. - public void AddTypeReader(TypeReader reader, bool replaceDefaultTypeReader) - => AddTypeReader(typeof(T), reader, replaceDefaultTypeReader); + /// If should replace the default for if one exists. + public void AddTypeReader(TypeReader reader, bool replaceDefault) + => AddTypeReader(typeof(T), reader, replaceDefault); /// /// Adds a custom to this for the supplied object type. /// If is a , a for the value type will also be added. /// /// A instance for the type to be read. /// An instance of the to be added. - /// If should replace the default for if one exists. - public void AddTypeReader(Type type, TypeReader reader, bool replaceDefaultTypeReader) + /// If should replace the default for if one exists. + public void AddTypeReader(Type type, TypeReader reader, bool replaceDefault) { - if (replaceDefaultTypeReader && _defaultTypeReaders.ContainsKey(type)) + if (replaceDefault && _defaultTypeReaders.ContainsKey(type)) { _defaultTypeReaders.AddOrUpdate(type, reader, (k, v) => reader); if (type.GetTypeInfo().IsValueType)