示例#1
0
        static async void OnUpdate(object sender, UpdateEventArgs e)
        {
            var botInstance = BotClient.GetMeAsync().Result; // Get the bot instance info.
            var update      = e.Update;

            if (update.Type != UpdateType.Message)
            {
                return;
            }
            if (update.Message.From.IsBot)
            {
                return;
            }
            // if (update.Message.Chat.Type != ChatType.Private) return;

            var accessLevel = CommandRouter.CheckAccessLevel(update, Vars.CurrentConf.OwnerUID);

            if (await CommandInstance.CommandManager.Execute(BotClient, update, accessLevel)) // Docking with permission system
            {
                return;
            }
        }