Adding IDeviceSession and IDeviceSessionMethods Interface
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Telegram.Bot.Types;
|
||||
using TelegramBotBase.Sessions;
|
||||
using TelegramBotBase.Interfaces;
|
||||
|
||||
namespace TelegramBotBase.Args;
|
||||
|
||||
@@ -15,7 +15,7 @@ public class BotCommandEventArgs : EventArgs
|
||||
}
|
||||
|
||||
public BotCommandEventArgs(string command, List<string> parameters, Message message, long deviceId,
|
||||
DeviceSession device)
|
||||
IDeviceSession device)
|
||||
{
|
||||
Command = command;
|
||||
Parameters = parameters;
|
||||
@@ -30,7 +30,7 @@ public class BotCommandEventArgs : EventArgs
|
||||
|
||||
public long DeviceId { get; set; }
|
||||
|
||||
public DeviceSession Device { get; set; }
|
||||
public IDeviceSession Device { get; set; }
|
||||
|
||||
public bool Handled { get; set; } = false;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using System;
|
||||
using TelegramBotBase.Sessions;
|
||||
using TelegramBotBase.Interfaces;
|
||||
|
||||
namespace TelegramBotBase.Base;
|
||||
|
||||
public class MessageIncomeEventArgs : EventArgs
|
||||
{
|
||||
public MessageIncomeEventArgs(long deviceId, DeviceSession device, MessageResult message)
|
||||
public MessageIncomeEventArgs(long deviceId, IDeviceSession device, MessageResult message)
|
||||
{
|
||||
DeviceId = deviceId;
|
||||
Device = device;
|
||||
@@ -14,7 +14,7 @@ public class MessageIncomeEventArgs : EventArgs
|
||||
|
||||
public long DeviceId { get; set; }
|
||||
|
||||
public DeviceSession Device { get; set; }
|
||||
public IDeviceSession Device { get; set; }
|
||||
|
||||
public MessageResult Message { get; set; }
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
using System;
|
||||
using TelegramBotBase.Sessions;
|
||||
using TelegramBotBase.Interfaces;
|
||||
|
||||
namespace TelegramBotBase.Base;
|
||||
|
||||
public class SessionBeginEventArgs : EventArgs
|
||||
{
|
||||
public SessionBeginEventArgs(long deviceId, DeviceSession device)
|
||||
public SessionBeginEventArgs(long deviceId, IDeviceSession device)
|
||||
{
|
||||
DeviceId = deviceId;
|
||||
Device = device;
|
||||
@@ -13,5 +13,5 @@ public class SessionBeginEventArgs : EventArgs
|
||||
|
||||
public long DeviceId { get; set; }
|
||||
|
||||
public DeviceSession Device { get; set; }
|
||||
public IDeviceSession Device { get; set; }
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using TelegramBotBase.Sessions;
|
||||
using TelegramBotBase.Interfaces;
|
||||
|
||||
namespace TelegramBotBase.Args;
|
||||
|
||||
@@ -9,7 +9,7 @@ public class SystemExceptionEventArgs : EventArgs
|
||||
{
|
||||
}
|
||||
|
||||
public SystemExceptionEventArgs(string command, long deviceId, DeviceSession device, Exception error)
|
||||
public SystemExceptionEventArgs(string command, long deviceId, IDeviceSession device, Exception error)
|
||||
{
|
||||
Command = command;
|
||||
DeviceId = deviceId;
|
||||
@@ -21,7 +21,7 @@ public class SystemExceptionEventArgs : EventArgs
|
||||
|
||||
public long DeviceId { get; set; }
|
||||
|
||||
public DeviceSession Device { get; set; }
|
||||
public IDeviceSession Device { get; set; }
|
||||
|
||||
public Exception Error { get; set; }
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using Telegram.Bot.Types;
|
||||
using TelegramBotBase.Sessions;
|
||||
using TelegramBotBase.Interfaces;
|
||||
|
||||
namespace TelegramBotBase.Args;
|
||||
|
||||
@@ -12,7 +12,7 @@ public class UnhandledCallEventArgs : EventArgs
|
||||
}
|
||||
|
||||
public UnhandledCallEventArgs(string command, string rawData, long deviceId, int messageId, Message message,
|
||||
DeviceSession device) : this()
|
||||
IDeviceSession device) : this()
|
||||
{
|
||||
Command = command;
|
||||
RawData = rawData;
|
||||
@@ -26,7 +26,7 @@ public class UnhandledCallEventArgs : EventArgs
|
||||
|
||||
public long DeviceId { get; set; }
|
||||
|
||||
public DeviceSession Device { get; set; }
|
||||
public IDeviceSession Device { get; set; }
|
||||
|
||||
public string RawData { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user