2020-10-05 04:40:38 +00:00
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
2020-04-02 18:27:55 +00:00
|
|
|
|
|
2021-10-15 01:55:04 +00:00
|
|
|
|
namespace BirthdayBot.BackgroundServices;
|
2020-04-02 18:27:55 +00:00
|
|
|
|
|
2021-10-15 01:55:04 +00:00
|
|
|
|
abstract class BackgroundService {
|
|
|
|
|
protected ShardInstance ShardInstance { get; }
|
2020-04-02 18:27:55 +00:00
|
|
|
|
|
2021-10-15 01:55:04 +00:00
|
|
|
|
public BackgroundService(ShardInstance instance) => ShardInstance = instance;
|
2020-04-02 18:27:55 +00:00
|
|
|
|
|
2021-10-15 01:55:04 +00:00
|
|
|
|
protected void Log(string message) => ShardInstance.Log(GetType().Name, message);
|
|
|
|
|
|
|
|
|
|
public abstract Task OnTick(int tickCount, CancellationToken token);
|
2020-04-02 18:27:55 +00:00
|
|
|
|
}
|