[REFACTOR] Change update variable position for better performance => FullMessageLoop

This commit is contained in:
AmirAbbas 2023-11-01 12:25:24 +03:30
parent 08a1af6722
commit 92335ec7c7
2 changed files with 1 additions and 4 deletions

View File

@ -22,7 +22,6 @@ public sealed class FormBaseMessageLoop : IMessageLoopFactory
{
var update = ur.RawData;
if (update.Type != UpdateType.Message
&& update.Type != UpdateType.EditedMessage
&& update.Type != UpdateType.CallbackQuery)

View File

@ -20,9 +20,6 @@ public sealed class FullMessageLoop : IMessageLoopFactory
public async Task MessageLoop(BotBase bot, DeviceSession session, UpdateResult ur, MessageResult mr)
{
var update = ur.RawData;
//Is this a bot command ?
if (mr.IsFirstHandler && mr.IsBotCommand && bot.IsKnownBotCommand(mr.BotCommand))
{
@ -50,6 +47,7 @@ public sealed class FullMessageLoop : IMessageLoopFactory
//Loading Event
await activeForm.Load(mr);
var update = ur.RawData;
//Is Attachment ? (Photo, Audio, Video, Contact, Location, Document) (Ignore Callback Queries)
if (update.Type == UpdateType.Message)