tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
IProvider.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Threading;
4using System.Threading.Tasks;
5
9
11{
16 {
20 bool Connected { get; }
21
25 bool Disposed { get; }
26
30 string BotMention { get; }
31
36
41
48 Task<Message?> NextMessage(CancellationToken cancellationToken);
49
55 ValueTask Disconnect(CancellationToken cancellationToken);
56
63 ValueTask<Dictionary<ChatChannel, IEnumerable<ChannelRepresentation>>> MapChannels(IEnumerable<ChatChannel> channels, CancellationToken cancellationToken);
64
73 ValueTask SendMessage(Message? replyTo, MessageContent message, ulong channelId, CancellationToken cancellationToken);
74
81 Task SetReconnectInterval(uint reconnectInterval, bool connectNow);
82
95 ValueTask<Func<string?, string, ValueTask<Func<bool, ValueTask>>>> SendUpdateMessage(
96 Models.RevisionInformation revisionInformation,
97 Api.Models.EngineVersion engineVersion,
98 DateTimeOffset? estimatedCompletionTime,
99 string? gitHubOwner,
100 string? gitHubRepo,
101 ulong channelId,
102 bool localCommitPushed,
103 CancellationToken cancellationToken);
104 }
105}
Represents a message received by a IProvider.
Definition Message.cs:9
Represents a message to send to a chat provider.
ValueTask Disconnect(CancellationToken cancellationToken)
Gracefully disconnects the provider. Permanently stops the reconnection timer.
ValueTask SendMessage(Message? replyTo, MessageContent message, ulong channelId, CancellationToken cancellationToken)
Send a message to the IProvider.
string BotMention
The string that indicates the IProvider was mentioned.
Definition IProvider.cs:30
Task< Message?> NextMessage(CancellationToken cancellationToken)
Get a Task<TResult> resulting in the next Message the IProvider receives or null on a disconnect.
Task SetReconnectInterval(uint reconnectInterval, bool connectNow)
Set the interval at which the provider starts jobs to try to reconnect.
Task InitialConnectionJob
A Task that completes once the IProvider finishes it's first connection attempt regardless of success...
Definition IProvider.cs:35
bool Connected
If the IProvider is currently connected.
Definition IProvider.cs:20
ValueTask< Dictionary< ChatChannel, IEnumerable< ChannelRepresentation > > > MapChannels(IEnumerable< ChatChannel > channels, CancellationToken cancellationToken)
Get the ChannelRepresentations for given channels .
ValueTask< Func< string?, string, ValueTask< Func< bool, ValueTask > > > > SendUpdateMessage(Models.RevisionInformation revisionInformation, Api.Models.EngineVersion engineVersion, DateTimeOffset? estimatedCompletionTime, string? gitHubOwner, string? gitHubRepo, ulong channelId, bool localCommitPushed, CancellationToken cancellationToken)
Send the message for a deployment.
void InitialMappingComplete()
Indicate to the provider that at least one MapChannels(IEnumerable<ChatChannel>, CancellationToken) c...
bool Disposed
If the IProvider was disposed.
Definition IProvider.cs:25