protected async Task <RestUserMessage> ReplyAsync( LocalisationStringKey stringKey, LocalMentions mentions = null, params object[] args) { var localisedString = await LocalisationService.GetResponseAsync(Context.Member.Id, Context.Guild.Id, stringKey, args); return(await Context.Channel.SendMessageAsync(localisedString, mentions : mentions ?? LocalMentions.None)); }
private string[] ParseLine(string line, out LocalisationStringKey key) { this._logger.LogDebug("Parsing line {line}", line); var split = line.Split('=', StringSplitOptions.RemoveEmptyEntries); if (split.Length != 2) { throw new InvalidOperationException("Language string must have format \"key=value\""); } if (!Enum.TryParse(split[0], out key)) { throw new InvalidOperationException($"{split[0]} was not recognised as a valid localisation key"); } return(split); }
public EspeonTypeParserFailedResult(LocalisationStringKey key) : base(key.ToString()) { }
protected async Task <RestUserMessage> ReplyAsync(LocalisationStringKey stringKey, params object[] args) { return(await ReplyAsync(stringKey, LocalMentions.None, args)); }