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> /// <summary>
/// See documentation in Kerobot_hooks. /// See <see cref="Kerobot.EcQueryUser(ulong, string)"/>.
/// </summary> /// </summary>
internal Task<CachedUser> QueryUserCache(ulong guildId, string search) => _uc.Query(guildId, search); 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. /// cached user will be returned.
/// </summary> /// </summary>
/// <param name="guildId">ID of the corresponding guild in which to search.</param> /// <param name="guildId">ID of the corresponding guild in which to search.</param>
/// <param name="search">Search string. Either </param> /// <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.</returns> /// <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); public Task<CachedUser> EcQueryUser(ulong guildId, string search) => _svcEntityCache.QueryUserCache(guildId, search);
} }
} }

View file

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