tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
DiscordForwardingResponder.cs
Go to the documentation of this file.
1using System;
2using System.Threading;
3using System.Threading.Tasks;
4
5using Remora.Discord.API.Abstractions.Gateway.Events;
6using Remora.Discord.Gateway.Responders;
7using Remora.Results;
8
10{
15 {
20
26 {
27 this.targetResponder = targetResponder ?? throw new ArgumentNullException(nameof(targetResponder));
28 }
29
31 public Task<Result> RespondAsync(IMessageCreate gatewayEvent, CancellationToken ct) => targetResponder.RespondAsync(gatewayEvent, ct);
32
34 public Task<Result> RespondAsync(IReady gatewayEvent, CancellationToken ct) => targetResponder.RespondAsync(gatewayEvent, ct);
35 }
36}
An IResponder<TGatewayEvent> that forwards to another targetResponder.
DiscordForwardingResponder(IDiscordResponders targetResponder)
Initializes a new instance of the DiscordForwardingResponder class.
Task< Result > RespondAsync(IMessageCreate gatewayEvent, CancellationToken ct)
readonly IDiscordResponders targetResponder
The IResponder<TGatewayEvent> to forward the event to.
Task< Result > RespondAsync(IReady gatewayEvent, CancellationToken ct)
Combined interface for the IResponder types used by TGS.