Improved documentation

This commit is contained in:
Noikoio 2019-03-16 17:07:57 -07:00
parent c843104e3c
commit 403703773b
3 changed files with 6 additions and 4 deletions

View file

@ -18,7 +18,7 @@ namespace Kerobot.Services.EntityCache
}
/// <summary>
/// See documentation in Kerobot_hooks.
/// See <see cref="Kerobot.EcQueryUser(ulong, string)"/>.
/// </summary>
internal Task<CachedUser> QueryUserCache(ulong guildId, string search) => _uc.Query(guildId, search);
}

View file

@ -13,8 +13,8 @@ namespace Kerobot
/// cached user will be returned.
/// </summary>
/// <param name="guildId">ID of the corresponding guild in which to search.</param>
/// <param name="search">Search string. Either </param>
/// <returns>A <see cref="CachedUser"/> instance containing cached information.</returns>
/// <param name="search">Search string. May be a name with discriminator, a name, or an ID.</param>
/// <returns>A <see cref="CachedUser"/> instance containing cached information, or null if no result.</returns>
public Task<CachedUser> EcQueryUser(ulong guildId, string search) => _svcEntityCache.QueryUserCache(guildId, search);
}
}

View file

@ -1,7 +1,6 @@
using Discord.WebSocket;
using NpgsqlTypes;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@ -133,6 +132,9 @@ namespace Kerobot.Services.EntityCache
#region Querying
private static Regex DiscriminatorSearch = new Regex(@"(.+)#(\d{4}(?!\d))", RegexOptions.Compiled);
/// <summary>
/// See <see cref="Kerobot.EcQueryUser(ulong, string)"/>.
/// </summary>
internal async Task<CachedUser> Query(ulong guildID, string search)
{
// Is search just a number? Assume ID, pass it on to the correct place.