[REFACTOR] Change update variable position for better performance => FullMessageLoop
This commit is contained in:
parent
08a1af6722
commit
92335ec7c7
@ -22,7 +22,6 @@ public sealed class FormBaseMessageLoop : IMessageLoopFactory
|
|||||||
{
|
{
|
||||||
var update = ur.RawData;
|
var update = ur.RawData;
|
||||||
|
|
||||||
|
|
||||||
if (update.Type != UpdateType.Message
|
if (update.Type != UpdateType.Message
|
||||||
&& update.Type != UpdateType.EditedMessage
|
&& update.Type != UpdateType.EditedMessage
|
||||||
&& update.Type != UpdateType.CallbackQuery)
|
&& update.Type != UpdateType.CallbackQuery)
|
||||||
|
|||||||
@ -20,9 +20,6 @@ public sealed class FullMessageLoop : IMessageLoopFactory
|
|||||||
|
|
||||||
public async Task MessageLoop(BotBase bot, DeviceSession session, UpdateResult ur, MessageResult mr)
|
public async Task MessageLoop(BotBase bot, DeviceSession session, UpdateResult ur, MessageResult mr)
|
||||||
{
|
{
|
||||||
var update = ur.RawData;
|
|
||||||
|
|
||||||
|
|
||||||
//Is this a bot command ?
|
//Is this a bot command ?
|
||||||
if (mr.IsFirstHandler && mr.IsBotCommand && bot.IsKnownBotCommand(mr.BotCommand))
|
if (mr.IsFirstHandler && mr.IsBotCommand && bot.IsKnownBotCommand(mr.BotCommand))
|
||||||
{
|
{
|
||||||
@ -50,6 +47,7 @@ public sealed class FullMessageLoop : IMessageLoopFactory
|
|||||||
//Loading Event
|
//Loading Event
|
||||||
await activeForm.Load(mr);
|
await activeForm.Load(mr);
|
||||||
|
|
||||||
|
var update = ur.RawData;
|
||||||
|
|
||||||
//Is Attachment ? (Photo, Audio, Video, Contact, Location, Document) (Ignore Callback Queries)
|
//Is Attachment ? (Photo, Audio, Video, Contact, Location, Document) (Ignore Callback Queries)
|
||||||
if (update.Type == UpdateType.Message)
|
if (update.Type == UpdateType.Message)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user