Browse Source

Allow replacing a default typereader globally

pull/975/head
Joe4evr 7 years ago
parent
commit
5958712267
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      src/Discord.Net.Commands/CommandService.cs

+ 8
- 0
src/Discord.Net.Commands/CommandService.cs View File

@@ -263,6 +263,14 @@ namespace Discord.Commands
}
return null;
}
public void ReplaceDefaultTypereader<T>(TypeReader reader)
{
var key = typeof(T);
if (_defaultTypeReaders.ContainsKey(key))
{
_defaultTypeReaders.AddOrUpdate(key, k => throw new Exception("This shouldn't happen?"), (k, v) => reader);
}
}

//Execution
public SearchResult Search(ICommandContext context, int argPos)


Loading…
Cancel
Save