Class GameChatBridgeService
- Namespace
- FishMMO.DiscordBot.Services
- Assembly
- FishMMO-DiscordBot.dll
Bridges Discord messages from managed game chat channels into the game database. Enforces rate limiting, bridge ban checks, and message length validation before insertion.
public class GameChatBridgeService
- Inheritance
-
GameChatBridgeService
- Inherited Members
Constructors
GameChatBridgeService(IServiceProvider, DynamicChannelManagerService, RateLimiterService, BridgeBanService, AccountLinkingService, ILogger<GameChatBridgeService>, IConfiguration)
Initializes a new instance of the GameChatBridgeService class.
public GameChatBridgeService(IServiceProvider serviceProvider, DynamicChannelManagerService dynamicChannelManager, RateLimiterService rateLimiter, BridgeBanService bridgeBanService, AccountLinkingService accountLinkingService, ILogger<GameChatBridgeService> logger, IConfiguration configuration)
Parameters
serviceProviderIServiceProviderService provider for creating scoped database contexts.
dynamicChannelManagerDynamicChannelManagerServiceService managing dynamic Discord channels.
rateLimiterRateLimiterServicePer-user rate limiter.
bridgeBanServiceBridgeBanServiceaccountLinkingServiceAccountLinkingServiceloggerILogger<GameChatBridgeService>Logger instance.
configurationIConfigurationApplication configuration.
Methods
BridgeMessageAsync(SocketUserMessage, SocketTextChannel)
Attempts to bridge a Discord message to the game database. Validates the channel is managed, the user is not rate-limited, and the message content is valid.
public Task<BridgeResult> BridgeMessageAsync(SocketUserMessage message, SocketTextChannel textChannel)
Parameters
messageSocketUserMessageThe Discord user message.
textChannelSocketTextChannelThe Discord text channel the message was sent in.
Returns
- Task<BridgeResult>
The result of the bridge attempt.