2024-07-16 00:48:55 -04:00
using HermesSocketLibrary.Socket.Data ;
2024-06-16 20:19:31 -04:00
using Serilog ;
2024-07-16 00:48:55 -04:00
using TwitchChatTTS.Hermes.Socket ;
2024-06-16 20:19:31 -04:00
using TwitchLib.Client.Models ;
namespace TwitchChatTTS.Chat.Commands
{
public class VersionCommand : ChatCommand
{
2024-07-16 00:48:55 -04:00
private readonly User _user ;
2024-06-16 20:19:31 -04:00
private ILogger _logger ;
2024-07-16 00:48:55 -04:00
public VersionCommand ( User user , ILogger logger )
2024-06-16 20:19:31 -04:00
: base ( "version" , "Does nothing." )
{
2024-07-16 00:48:55 -04:00
_user = user ;
2024-06-16 20:19:31 -04:00
_logger = logger ;
}
2024-07-16 00:48:55 -04:00
public override async Task < bool > CheckDefaultPermissions ( ChatMessage message )
2024-06-16 20:19:31 -04:00
{
return message . IsBroadcaster ;
}
2024-07-16 00:48:55 -04:00
public override async Task Execute ( IList < string > args , ChatMessage message , HermesSocketClient client )
2024-06-16 20:19:31 -04:00
{
_logger . Information ( $"Version: {TTS.MAJOR_VERSION}.{TTS.MINOR_VERSION}" ) ;
2024-07-16 00:48:55 -04:00
await client . SendLoggingMessage ( HermesLoggingLevel . Info , $"{_user.TwitchUsername} [twitch id: {_user.TwitchUserId}] using version {TTS.MAJOR_VERSION}.{TTS.MINOR_VERSION}." ) ;
2024-06-16 20:19:31 -04:00
}
}
}