Refactor bot event handling, add OnMessage call in OnUpdate.

This commit is contained in:
2024-09-16 00:37:27 +03:30
parent 91b28d34b6
commit 9fd9364257

View File

@@ -41,7 +41,6 @@ public class MastodonBot
var me = await bot.GetMeAsync();
await bot.DropPendingUpdatesAsync();
bot.OnMessage += OnMessage;
bot.OnUpdate += OnUpdate;
@@ -58,6 +57,7 @@ public class MastodonBot
else {await HandlePostAction.HandleCallbackQuery(callbackQuery, db, bot, logger); break;}
}
case { Message: { } message }: await OnMessage(message, update.Type); break;
default: logger.LogInformation($"Received unhandled update {update.Type}"); break;
};
}