/// <inheritdoc/> public Task <Result> RespondAsync(IMessageCreate gatewayEvent, CancellationToken ct = default) { var key = KeyHelpers.CreateMessageCacheKey(gatewayEvent.ChannelID, gatewayEvent.ID); _cacheService.Cache <IMessage>(key, gatewayEvent); return(Task.FromResult(Result.FromSuccess())); }
/// <inheritdoc /> public async Task <Result> RespondAsync(IMessageCreate gatewayEvent, CancellationToken ct = default) { var isBot = gatewayEvent.Author.IsBot.HasValue && gatewayEvent.Author.IsBot.Value; var isSystem = gatewayEvent.Author.IsSystem.HasValue && gatewayEvent.Author.IsSystem.Value; if (isBot || isSystem) { return(Result.FromSuccess()); } if (!gatewayEvent.GuildID.IsDefined(out var guildID)) { return(Result.FromSuccess()); } return(await _roleplays.ConsumeMessageAsync(gatewayEvent, guildID)); }